From 9346c46e623475f58b84581af4a01855983b5cb7 Mon Sep 17 00:00:00 2001 From: Bill Thiede Date: Mon, 24 Feb 2025 14:55:51 -0800 Subject: [PATCH] web: change exit catchup behavior to view current message --- web/src/state.rs | 8 ++++++-- web/src/view/mod.rs | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/web/src/state.rs b/web/src/state.rs index 71458bb..5ef23b6 100644 --- a/web/src/state.rs +++ b/web/src/state.rs @@ -586,7 +586,7 @@ pub fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders) { model.versions.server = Some(version); } - Msg::StartCatchup => { + Msg::CatchupStart => { let query = if model.query.contains("is:unread") { model.query.to_string() } else { @@ -625,6 +625,9 @@ pub fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders) { return; }; } + Msg::CatchupExit => { + model.catchup = None; + } } } @@ -778,8 +781,9 @@ pub enum Msg { SetProgress(f64), UpdateServerVersion(String), - StartCatchup, + CatchupStart, CatchupKeepUnread, CatchupMarkAsRead, CatchupNext, + CatchupExit, } diff --git a/web/src/view/mod.rs b/web/src/view/mod.rs index 0542c83..834bab7 100644 --- a/web/src/view/mod.rs +++ b/web/src/view/mod.rs @@ -193,7 +193,7 @@ fn catchup_view( div![ C!["absolute", "right-4", "text-gray-500"], span![i![C!["fas", "fa-x"]]], - ev(Ev::Click, move |_| Msg::GoToSearchResults) + ev(Ev::Click, move |_| Msg::CatchupExit) ], h1![ C!["text-center"], @@ -449,7 +449,7 @@ fn search_toolbar( attrs! {At::Title => "Mark as read"}, span![i![C!["far", "fa-eye"]]], span![C!["pl-2", "hidden", "md:inline"], "Catch-up"], - ev(Ev::Click, |_| Msg::StartCatchup) + ev(Ev::Click, |_| Msg::CatchupStart) ]], ], div![