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
This commit is contained in:
əlemi 2024-04-24 05:47:18 +02:00
parent 6c92328b8d
commit 1a3cc5e2ff
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -35,7 +35,11 @@ impl Timeline {
.collect(); .collect();
let mut feed = self.feed.get(); 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); feed.append(&mut older);
self.feed.set(feed); self.feed.set(feed);