forked from alemi/upub
fix(web): start with menu closed on mobile
This commit is contained in:
parent
a38302219c
commit
9f66ee4f95
2 changed files with 4 additions and 1 deletions
|
@ -28,3 +28,4 @@ futures = "0.3.30"
|
||||||
dissolve = "0.2" # TODO strip html without this crate
|
dissolve = "0.2" # TODO strip html without this crate
|
||||||
lazy_static = "1.4"
|
lazy_static = "1.4"
|
||||||
chrono = { version = "0.4", features = ["serde"] }
|
chrono = { version = "0.4", features = ["serde"] }
|
||||||
|
web-sys = { version = "0.3", features = ["Screen"] }
|
||||||
|
|
|
@ -17,7 +17,9 @@ fn main() {
|
||||||
let home_tl = Timeline::new(format!("{URL_BASE}/users/{}/inbox/page", username.get().unwrap_or_default()));
|
let home_tl = Timeline::new(format!("{URL_BASE}/users/{}/inbox/page", username.get().unwrap_or_default()));
|
||||||
let server_tl = Timeline::new(format!("{URL_BASE}/inbox/page"));
|
let server_tl = Timeline::new(format!("{URL_BASE}/inbox/page"));
|
||||||
|
|
||||||
let (menu, set_menu) = create_signal(false);
|
let screen_width = window().screen().map(|x| x.avail_width().unwrap_or_default()).unwrap_or_default();
|
||||||
|
|
||||||
|
let (menu, set_menu) = create_signal(screen_width <= 786);
|
||||||
|
|
||||||
spawn_local(async move {
|
spawn_local(async move {
|
||||||
if let Err(e) = server_tl.more(token).await {
|
if let Err(e) = server_tl.more(token).await {
|
||||||
|
|
Loading…
Reference in a new issue