Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove duplicate posts caused by reposts

+17 -1
+17 -1
src/state/models/feed-view.ts
··· 457 457 } else { 458 458 this.feed = this.feed.concat(toAppend) 459 459 } 460 + dedupReposts(this.feed) 460 461 dedupParents(this.feed) 461 462 }) 462 463 } ··· 595 596 return reorg 596 597 } 597 598 599 + // WARNING: mutates `feed` 600 + function dedupReposts(feed: FeedItemModel[]) { 601 + // remove duplicates caused by reposts 602 + for (let i = 0; i < feed.length; i++) { 603 + const item1 = feed[i] 604 + for (let j = i + 1; j < feed.length; j++) { 605 + const item2 = feed[j] 606 + if (item1.post.uri === item2.post.uri) { 607 + feed.splice(j, 1) 608 + j-- 609 + } 610 + } 611 + } 612 + } 613 + 614 + // WARNING: mutates `feed` 598 615 function dedupParents(feed: FeedItemModel[]) { 599 616 // only show parents that aren't already in the feed 600 - // NOTE if a parent post arrives in a followup loadmore, it'll show when we otherwise wish it wouldnt -prf 601 617 for (let i = 0; i < feed.length; i++) { 602 618 const item1 = feed[i] 603 619 if (!item1.replyParent || item1._isThreadChild) {