blob: aa5bde6ad191d646ab36e79407b3a4381e6c9b78 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
module.exports = Ferdium => {
const getMessages = () => {
const unreadSpan = document.querySelector(
'span.flag-count.message-count.unread-count',
);
let directCount = 0;
if (unreadSpan) {
directCount = Ferdium.safeParseInt(unreadSpan.textContent);
}
Ferdium.setBadge(directCount);
};
Ferdium.loop(getMessages);
};
|