Dedup posts in the home TL

zio/stable
Paul Frazee 2022-11-18 14:05:19 -06:00
parent 6e2b7a0b90
commit fbb9689e4a
1 changed files with 10 additions and 0 deletions

View File

@ -388,6 +388,16 @@ export class FeedModel {
this.hasMore = !!this.loadMoreCursor
let counter = this.feed.length
for (const item of res.data.feed) {
// HACK
// deduplicate posts on the home feed
// (should be done on the server)
// -prf
if (this.feedType === 'home') {
if (this.feed.find(item2 => item2.uri === item.uri)) {
continue
}
}
this._append(counter++, item)
}
}