diff --git a/web/Cargo.toml b/web/Cargo.toml index 824e2b69..40d42a02 100644 --- a/web/Cargo.toml +++ b/web/Cargo.toml @@ -28,3 +28,4 @@ futures = "0.3.30" dissolve = "0.2" # TODO strip html without this crate lazy_static = "1.4" chrono = { version = "0.4", features = ["serde"] } +web-sys = { version = "0.3", features = ["Screen"] } diff --git a/web/src/main.rs b/web/src/main.rs index 15ad5e42..c7fd8c6d 100644 --- a/web/src/main.rs +++ b/web/src/main.rs @@ -17,7 +17,9 @@ fn main() { 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 (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 { if let Err(e) = server_tl.more(token).await {