From 3235bffdca66f1a4a20adf844e34f0584d4fa2d2 Mon Sep 17 00:00:00 2001 From: relikd Date: Sat, 25 Oct 2025 12:36:12 +0200 Subject: [PATCH] fix: lower bound on status bar count --- baRSS/Status Bar Menu/BarStatusItem.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/baRSS/Status Bar Menu/BarStatusItem.m b/baRSS/Status Bar Menu/BarStatusItem.m index 4b0f503..1d3d21b 100644 --- a/baRSS/Status Bar Menu/BarStatusItem.m +++ b/baRSS/Status Bar Menu/BarStatusItem.m @@ -70,7 +70,7 @@ /// Assign total unread count value directly. - (void)setUnreadCountAbsolute:(NSUInteger)count { - _unreadCountTotal = (NSInteger)count; + _unreadCountTotal = count > 0 ? (NSInteger)count : 0; [self updateBarIcon]; [NotifyEndpoint setGlobalCount:count]; } @@ -78,6 +78,9 @@ /// Assign new value by adding @c count to total unread count (may be negative). - (void)setUnreadCountRelative:(NSInteger)count { _unreadCountTotal += count; + if (_unreadCountTotal < 0) { + _unreadCountTotal = 0; + } [self updateBarIcon]; [NotifyEndpoint setGlobalCount:(NSUInteger)_unreadCountTotal]; }