Don't show new-content notification for reposts (close #179) (#197)

This commit is contained in:
Paul Frazee
2023-02-14 16:54:35 -06:00
committed by GitHub
parent 7d162c8101
commit f331fb9c75
+10 -8
View File
@@ -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)
}
/**