diff --git a/web/src/app.rs b/web/src/app.rs index b9c7a071..4668ba8c 100644 --- a/web/src/app.rs +++ b/web/src/app.rs @@ -160,6 +160,25 @@ pub fn App() -> impl IntoView { #[component] fn Scrollable() -> impl IntoView { let location = use_location(); + let feeds = use_context::().expect("missing feeds context"); + let relevant_timeline = Signal::derive(move || { + let path = location.pathname.get(); + if path.contains("/web/home") { + Some(feeds.home) + } else if path.contains("/web/server") { + Some(feeds.global) + } else if path.starts_with("/web/local") { + Some(feeds.server) + } else if path.starts_with("/web/inbox") { + Some(feeds.private) + } else if path.starts_with("/web/actors") { + Some(feeds.user) + } else if path.starts_with("/web/objects") { + Some(feeds.context) + } else { + None + } + }); let breadcrumb = Signal::derive(move || { let path = location.pathname.get(); let mut path_iter = path.split('/').skip(2); @@ -193,6 +212,9 @@ fn Scrollable() -> impl IntoView {
"<<" {crate::NAME}" :: "{breadcrumb} + {move || relevant_timeline.get().map(|tl| view! { + "♻️" + })}
diff --git a/web/src/timeline/mod.rs b/web/src/timeline/mod.rs index 294fc072..e9a03675 100644 --- a/web/src/timeline/mod.rs +++ b/web/src/timeline/mod.rs @@ -40,6 +40,16 @@ impl Timeline { } } + pub fn refresh(&self) { + self.reset( + self.next + .get_untracked() + .split('?') + .next() + .map(|x| x.to_string()) + ); + } + pub fn spawn_more(&self, auth: Auth) { let _self = *self; spawn_local(async move {