Fix unread count update in folder strip.

This commit is contained in:
John Preston 2025-05-07 16:39:42 +04:00
parent f96f478470
commit a49cb06d77
2 changed files with 10 additions and 7 deletions

View file

@ -101,14 +101,16 @@ void ChatsFiltersTabs::setUnreadCount(int index, int unreadCount, bool mute) {
int(std::numeric_limits<ushort>::max()))), int(std::numeric_limits<ushort>::max()))),
.muted = mute, .muted = mute,
}); });
update();
} }
} else { } else if (!unreadCount) {
if (unreadCount) { _unreadCounts.erase(it);
it->second.count = unreadCount; update();
it->second.cache = cacheUnreadCount(unreadCount, mute); } else if (it->second.count != unreadCount || it->second.muted != mute) {
} else { it->second.count = unreadCount;
_unreadCounts.erase(it); it->second.muted = mute;
} it->second.cache = cacheUnreadCount(unreadCount, mute);
update();
} }
if (unreadCount) { if (unreadCount) {
const auto widthIndex = (unreadCount < 10) const auto widthIndex = (unreadCount < 10)

View file

@ -118,6 +118,7 @@ void DiscreteSlider::refresh() {
_selected = 0; _selected = 0;
} }
resizeToWidth(width()); resizeToWidth(width());
update();
} }
DiscreteSlider::Range DiscreteSlider::getFinalActiveRange() const { DiscreteSlider::Range DiscreteSlider::getFinalActiveRange() const {