diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-01-25 17:57:53 -0600 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2023-01-25 17:57:53 -0600 |
commit | 67e9b3596d6690b4928206652db4a89d11870914 (patch) | |
tree | df144439c3ca035ba9e36acea4762775c6ec6de9 /src | |
parent | e08a46f0c64d11c6f62561f7861356f14b011ae2 (diff) | |
download | voidsky-67e9b3596d6690b4928206652db4a89d11870914.tar.zst |
Fix: dont dedup reposts that are in threads, as that can cause rendering issues (close #71)
Diffstat (limited to 'src')
-rw-r--r-- | src/state/models/feed-view.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/state/models/feed-view.ts b/src/state/models/feed-view.ts index d8eb95ef2..621059822 100644 --- a/src/state/models/feed-view.ts +++ b/src/state/models/feed-view.ts @@ -87,6 +87,12 @@ export class FeedItemModel { this.reason = v.reason } + get _isRenderingAsThread() { + return ( + this._isThreadParent || this._isThreadChild || this._isThreadChildElided + ) + } + get reasonRepost(): ReasonRepost | undefined { if (this.reason?.$type === 'app.bsky.feed.feedViewPost#reasonRepost') { return this.reason as ReasonRepost @@ -627,6 +633,10 @@ function dedupReposts(feed: FeedItemModel[]) { const item1 = feed[i] for (let j = i + 1; j < feed.length; j++) { const item2 = feed[j] + if (item2._isRenderingAsThread) { + // dont dedup items that are rendering in a thread as this can cause rendering errors + continue + } if (item1.post.uri === item2.post.uri) { feed.splice(j, 1) j-- |