blob: 745e8078a80daf929dfce3eb7a141c2ba4f589e5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
module.exports = (Ferdium) => {
function getNotifications() {
let unreadNotifications = 0;
for (const notificationCounterElement of document.querySelectorAll(
".notification__count"
)) {
unreadNotifications =
unreadNotifications +
Ferdium.safeParseInt(notificationCounterElement.textContent);
}
Ferdium.setBadge(unreadNotifications);
}
Ferdium.loop(getNotifications);
};
|