Skip to content

fix: clamp unreadCount to non-negative on mark read/unread#784

Open
wwhsaber wants to merge 1 commit into
yang991178:masterfrom
wwhsaber:fix/negative-unread-count
Open

fix: clamp unreadCount to non-negative on mark read/unread#784
wwhsaber wants to merge 1 commit into
yang991178:masterfrom
wwhsaber:fix/negative-unread-count

Conversation

@wwhsaber

Copy link
Copy Markdown

What

Prevent unread badges from going negative when marking items read.

Why

MARK_READ decrements unreadCount without a floor. After desynced or repeated mark-read actions, the menu can show negative unread numbers.

Closes #511

Changes

  • Clamp unreadCount with Math.max(0, ...) in the source reducer for MARK_READ / MARK_UNREAD

Verification

  • Review reducer path for MARK_READ/MARK_UNREAD
  • Unread badge display already hides zero; this prevents negative values from rendering

MARK_READ decrements unreadCount without a lower bound, so repeated
or desynced mark-read actions can show negative unread badges.

Closes yang991178#511
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The number of unread articles is shown as a negative number

2 participants