Check if message has unread badge before changing it.
This commit is contained in:
parent
18394c5358
commit
418f858807
1 changed files with 1 additions and 1 deletions
2
js/ui.js
2
js/ui.js
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue