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