blob: 69c468e441b5f4b540b0423c6af4bcbad3ceea14 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
|
const NOTIFICATION_BADGE_CLASS = '.badge-round';
module.exports = Ferdi => {
const getMessages = () => {
const badges = [...document.querySelectorAll(NOTIFICATION_BADGE_CLASS)];
const messages = badges.reduce((currentValue, element) => currentValue + Number(element.innerText), 0);
Ferdi.setBadge(messages);
};
Ferdi.loop(getMessages);
};
|