From f8473a5ce197ebff4587838b5b95347644476264 Mon Sep 17 00:00:00 2001 From: alemi Date: Fri, 3 May 2024 04:51:59 +0200 Subject: [PATCH] feat(web): refresh button for context and user i really dont like this tho it shifts the breadcrumb a lot and its weird that it appears also implemented kinda jankily idkkkk --- web/src/components/timeline.rs | 8 ++++++++ web/src/page.rs | 34 ++++++++++++++++++++++++++++++++-- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/web/src/components/timeline.rs b/web/src/components/timeline.rs index 9749ac5c..0f6ed6da 100644 --- a/web/src/components/timeline.rs +++ b/web/src/components/timeline.rs @@ -21,6 +21,14 @@ impl Timeline { Timeline { feed, next, over, loading } } + pub fn len(&self) -> usize { + self.feed.get().len() + } + + pub fn is_empty(&self) -> bool { + self.feed.get().is_empty() + } + pub fn reset(&self, url: String) { self.feed.set(vec![]); self.next.set(url); diff --git a/web/src/page.rs b/web/src/page.rs index f3c3df70..03ba6af5 100644 --- a/web/src/page.rs +++ b/web/src/page.rs @@ -75,7 +75,22 @@ pub fn UserPage(tl: Timeline) -> impl IntoView { }); view! {
- users::view + + users::view + + "\u{1f5d8}" + +
{move || { let uid = uid.clone(); @@ -194,7 +209,22 @@ pub fn ObjectPage(tl: Timeline) -> impl IntoView { }); view! {
- objects::view + + objects::view + + "\u{1f5d8}" + +
{move || match object.get() { None => view! {

loading ...

}.into_view(),