From 1a3cc5e2ff47ec8b34a57338a2120466cc092219 Mon Sep 17 00:00:00 2001 From: alemi Date: Wed, 24 Apr 2024 05:47:18 +0200 Subject: [PATCH] fix(web): don't insert activities already seen this happens because we're paginating with just an offset, meaning that when new activities get inserted that offset "gets shifted forward" and we receive again some activities we saw already. this should get fixed for good on the backend, but for now discarding them here makes it usable --- web/src/components/timeline.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/src/components/timeline.rs b/web/src/components/timeline.rs index 19a91540..6df45802 100644 --- a/web/src/components/timeline.rs +++ b/web/src/components/timeline.rs @@ -35,7 +35,11 @@ impl Timeline { .collect(); let mut feed = self.feed.get(); - let mut older = process_activities(activities, auth).await; + let mut older = process_activities(activities, auth) + .await + .into_iter() + .filter(|x| !feed.contains(x)) + .collect(); feed.append(&mut older); self.feed.set(feed);