From f331fb9c7505b085836c598b86585959dc682172 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Tue, 14 Feb 2023 16:54:35 -0600 Subject: [PATCH] Don't show new-content notification for reposts (close #179) (#197) --- src/state/models/feed-view.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/state/models/feed-view.ts b/src/state/models/feed-view.ts index 61c87afb05..08dc024909 100644 --- a/src/state/models/feed-view.ts +++ b/src/state/models/feed-view.ts @@ -406,14 +406,16 @@ export class FeedModel { } const res = await this._getFeed({limit: 1}) const currentLatestUri = this.pollCursor - const receivedLatestUri = res.data.feed[0] - ? res.data.feed[0].post.uri - : undefined - const hasNewLatest = Boolean( - receivedLatestUri && - (this.feed.length === 0 || receivedLatestUri !== currentLatestUri), - ) - this.setHasNewLatest(hasNewLatest) + const item = res.data.feed[0] + if (!item) { + return + } + if (AppBskyFeedFeedViewPost.isReasonRepost(item.reason)) { + if (item.reason.by.did === this.rootStore.me.did) { + return // ignore reposts by the user + } + } + this.setHasNewLatest(item.post.uri !== currentLatestUri) } /**