A few fixes to ensure threads show up as often as possible
parent
b542f0f7f8
commit
eab855ffff
|
@ -28,13 +28,16 @@ export class FeedViewPostsSlice {
|
||||||
get isThread() {
|
get isThread() {
|
||||||
return (
|
return (
|
||||||
this.items.length > 1 &&
|
this.items.length > 1 &&
|
||||||
!this.items[0].reply &&
|
|
||||||
this.items.every(
|
this.items.every(
|
||||||
item => item.post.author.did === this.items[0].post.author.did,
|
item => item.post.author.did === this.items[0].post.author.did,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get isFullThread() {
|
||||||
|
return this.isThread && !this.items[0].reply
|
||||||
|
}
|
||||||
|
|
||||||
get isReply() {
|
get isReply() {
|
||||||
return this.items.length > 1 && !this.isThread
|
return this.items.length > 1 && !this.isThread
|
||||||
}
|
}
|
||||||
|
@ -119,7 +122,7 @@ export class FeedTuner {
|
||||||
// remove any items already "seen"
|
// remove any items already "seen"
|
||||||
const soonToBeSeenUris: Set<string> = new Set()
|
const soonToBeSeenUris: Set<string> = new Set()
|
||||||
for (let i = slices.length - 1; i >= 0; i--) {
|
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)
|
slices.splice(i, 1)
|
||||||
} else {
|
} else {
|
||||||
for (const item of slices[i].items) {
|
for (const item of slices[i].items) {
|
||||||
|
@ -183,7 +186,7 @@ export class FeedTuner {
|
||||||
static likedRepliesOnly(tuner: FeedTuner, slices: FeedViewPostsSlice[]) {
|
static likedRepliesOnly(tuner: FeedTuner, slices: FeedViewPostsSlice[]) {
|
||||||
// remove any replies without at least 2 likes
|
// remove any replies without at least 2 likes
|
||||||
for (let i = slices.length - 1; i >= 0; i--) {
|
for (let i = slices.length - 1; i >= 0; i--) {
|
||||||
if (slices[i].isThread) {
|
if (slices[i].isFullThread) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
const item = slices[i].rootItem
|
const item = slices[i].rootItem
|
||||||
|
|
|
@ -200,7 +200,6 @@ export class FeedSliceModel {
|
||||||
get isThread() {
|
get isThread() {
|
||||||
return (
|
return (
|
||||||
this.items.length > 1 &&
|
this.items.length > 1 &&
|
||||||
!this.items[0].reply &&
|
|
||||||
this.items.every(
|
this.items.every(
|
||||||
item => item.post.author.did === this.items[0].post.author.did,
|
item => item.post.author.did === this.items[0].post.author.did,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue