Check if message has unread badge before changing it.

This commit is contained in:
天クマ 2026-07-19 10:42:57 -03:00
commit 418f858807

View file

@ -154,7 +154,7 @@ export const ui = {
if (!msg.fromMe && (!activeChatState || activeChatState.id !== (msg.fromMe ? msg.to : msg.from))) {
const unreadBadge = chat.querySelector('.unread-badge');
unreadBadge.innerText = (Number(unreadBadge.innerHTML) || 0) + 1;
if (unreadBadge) unreadBadge.innerText = (Number(unreadBadge.innerHTML) || 0) + 1;
}
}
},