From 66e8e00a9bbd0068e8b2770e3dde34911a9647b0 Mon Sep 17 00:00:00 2001 From: Bill Thiede Date: Mon, 9 Sep 2024 20:21:51 -0700 Subject: [PATCH] web: remove dead code --- web/src/state.rs | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/web/src/state.rs b/web/src/state.rs index 99e9634..de2c1b8 100644 --- a/web/src/state.rs +++ b/web/src/state.rs @@ -57,25 +57,6 @@ pub fn init(url: Url, orders: &mut impl Orders) -> Model { } } -fn compute_scroll_ratio() -> Msg { - // TODO: compute completion based on contents of the post, not the overall body (which includes - // 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() - .expect("window height") - .unchecked_into::() - .value_of(); - let scroll_y = window.scroll_y().expect("scroll Y"); - - let end = sh - ih; - let ratio = scroll_y / end; - Msg::SetProgress(ratio) -} fn on_url_changed(uc: subs::UrlChanged) -> Msg { let mut url = uc.0; info!(