Fix unread channel counts and badges

This commit is contained in:
AidarKC
2026-08-21 13:45:49 +04:00
parent 47a4844ce8
commit 745a0e39d7
5 changed files with 18 additions and 7 deletions
+5 -3
View File
@@ -1230,8 +1230,6 @@ function renderListContent({ screen, container, listState, navigate, refreshFeed
const count = document.createElement('span');
count.className = 'unread channel-row-count';
const unreadCount = Number(channel.unreadCount || 0);
count.textContent = unreadCount > 0 ? String(unreadCount) : '';
count.classList.toggle('is-empty', unreadCount <= 0);
if (!isGuest) {
const menuButton = document.createElement('button');
@@ -1261,7 +1259,11 @@ function renderListContent({ screen, container, listState, navigate, refreshFeed
});
controls.append(menuButton);
}
controls.append(time, count);
controls.append(time);
if (unreadCount > 0) {
count.textContent = unreadCount > 99 ? '99+' : String(unreadCount);
controls.append(count);
}
row.append(avatar, main, controls);
row.addEventListener('click', () => {