diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-03-21 13:47:17 -0500 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2023-03-21 13:47:17 -0500 |
commit | eab855ffffcb7e9aae0c5e9a72056dc4fcd5e430 (patch) | |
tree | eb6b46a45bdca7be9d6b35382f72abd20778f804 /src/lib/api/feed-manip.ts | |
parent | b542f0f7f8fc9cc93e22d964d8bab1ba30d47204 (diff) | |
download | voidsky-eab855ffffcb7e9aae0c5e9a72056dc4fcd5e430.tar.zst |
A few fixes to ensure threads show up as often as possible
Diffstat (limited to 'src/lib/api/feed-manip.ts')
-rw-r--r-- | src/lib/api/feed-manip.ts | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/api/feed-manip.ts b/src/lib/api/feed-manip.ts index f6b54a175..664bacd88 100644 --- a/src/lib/api/feed-manip.ts +++ b/src/lib/api/feed-manip.ts @@ -28,13 +28,16 @@ export class FeedViewPostsSlice { get isThread() { return ( this.items.length > 1 && - !this.items[0].reply && this.items.every( item => item.post.author.did === this.items[0].post.author.did, ) ) } + get isFullThread() { + return this.isThread && !this.items[0].reply + } + get isReply() { return this.items.length > 1 && !this.isThread } @@ -119,7 +122,7 @@ export class FeedTuner { // remove any items already "seen" const soonToBeSeenUris: Set<string> = new Set() for (let i = slices.length - 1; i >= 0; i--) { - if (this.seenUris.has(slices[i].uri)) { + if (!slices[i].isThread && this.seenUris.has(slices[i].uri)) { slices.splice(i, 1) } else { for (const item of slices[i].items) { @@ -183,7 +186,7 @@ export class FeedTuner { static likedRepliesOnly(tuner: FeedTuner, slices: FeedViewPostsSlice[]) { // remove any replies without at least 2 likes for (let i = slices.length - 1; i >= 0; i--) { - if (slices[i].isThread) { + if (slices[i].isFullThread) { continue } const item = slices[i].rootItem |