Skip to content

Commit

Permalink
fix: mark unread action
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Jul 18, 2024
1 parent ead8492 commit c5ab7af
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/renderer/src/store/entry/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,13 @@ class EntryActions {
}

async markRead(feedId: string, entryId: string, read: boolean) {
feedUnreadActions.incrementByFeedId(feedId, read ? -1 : 1)
const currentIsRead = get().flatMapEntries[entryId]?.read

if (currentIsRead) return
if (read && currentIsRead) {
return
}

feedUnreadActions.incrementByFeedId(feedId, read ? -1 : 1)

this.patch(entryId, {
read,
Expand Down

0 comments on commit c5ab7af

Please sign in to comment.