From b1e761b26f85eab61c03b030e4b535c0b3e564d5 Mon Sep 17 00:00:00 2001 From: Bill Thiede Date: Sun, 1 Sep 2024 15:48:11 -0700 Subject: [PATCH] web: don't show progress bar until 400px have scrolled --- web/src/state.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/src/state.rs b/web/src/state.rs index 074f58f..e29045b 100644 --- a/web/src/state.rs +++ b/web/src/state.rs @@ -62,6 +62,8 @@ fn compute_scroll_ratio() -> Msg { // the tags at the end on mobile/tablet). let body = document().body().expect("body"); let sh = body.scroll_height() as f64; + // HACK: don't report percent until a fixed amount of scrolling has happened + let sh = if sh < 400. { 0. } else { sh }; let window = window(); let ih = window .inner_height()