A few fixes to ensure threads show up as often as possible

zio/stable
Paul Frazee 2023-03-21 13:47:17 -05:00
parent b542f0f7f8
commit eab855ffff
2 changed files with 6 additions and 4 deletions

View File

@ -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

View File

@ -200,7 +200,6 @@ export class FeedSliceModel {
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,
)