1
0
Fork 0
forked from alemi/upub

fix(web): start with menu closed on mobile

This commit is contained in:
əlemi 2024-04-17 15:52:08 +02:00
parent a38302219c
commit 9f66ee4f95
Signed by: alemi
GPG key ID: A4895B84D311642C
2 changed files with 4 additions and 1 deletions

View file

@ -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"] }

View file

@ -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 {