blob: 399133d4e88cbfb62ffbf80dc5745d03c06688a8 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
module.exports = (Ferdium) => {
function getMessages() {
let direct = 0;
for (const indicator of document.querySelectorAll('.msgs-indicator')) {
direct += Ferdium.safeParseInt(indicator.textContent)
}
direct = direct / 2 // as the messages are provided in 2 different locations..
Ferdium.setBadge(direct);
}
Ferdium.loop(getMessages);
};
|