diff --git a/src/ui/feed.rs b/src/ui/feed.rs index 6c246170..90ba1f8b 100644 --- a/src/ui/feed.rs +++ b/src/ui/feed.rs @@ -38,6 +38,7 @@ pub(super) fn update(app: &mut GossipUi, ctx: &Context, frame: &mut eframe::Fram app.page = Page::FeedGeneral; GLOBALS.feed.set_feed_to_general(); feed_kind = FeedKind::General; + GLOBALS.event_is_new.blocking_write().clear(); } ui.separator(); if ui @@ -50,14 +51,17 @@ pub(super) fn update(app: &mut GossipUi, ctx: &Context, frame: &mut eframe::Fram app.page = Page::FeedReplies; GLOBALS.feed.set_feed_to_replies(); feed_kind = FeedKind::Replies; + GLOBALS.event_is_new.blocking_write().clear(); } if matches!(feed_kind, FeedKind::Thread(..)) { ui.separator(); ui.selectable_value(&mut app.page, Page::FeedThread, "Thread"); + GLOBALS.event_is_new.blocking_write().clear(); } if matches!(feed_kind, FeedKind::Person(..)) { ui.separator(); ui.selectable_value(&mut app.page, Page::FeedPerson, "Person"); + GLOBALS.event_is_new.blocking_write().clear(); } }); ui.separator(); @@ -373,7 +377,6 @@ fn render_post_actual( // Try LayoutJob - /* currently all events are new because the code that stales them is now gone #[allow(clippy::collapsible_else_if)] let bgcolor = if GLOBALS.event_is_new.blocking_read().contains(&event.id) { if ctx.style().visuals.dark_mode { @@ -388,13 +391,6 @@ fn render_post_actual( Color32::WHITE } }; - */ - - let bgcolor = if ctx.style().visuals.dark_mode { - Color32::BLACK - } else { - Color32::WHITE - }; Frame::none().fill(bgcolor).show(ui, |ui| { ui.horizontal(|ui| { diff --git a/src/ui/mod.rs b/src/ui/mod.rs index e949199c..6b7c0b74 100644 --- a/src/ui/mod.rs +++ b/src/ui/mod.rs @@ -198,6 +198,7 @@ impl eframe::App for GossipUi { .clicked() { self.page = Page::FeedGeneral; + GLOBALS.event_is_new.blocking_write().clear(); } ui.separator(); if ui