blob: 445eebe7badee2ce8f37acf4db4744883bab38ea (
plain) (
blame)
1
2
3
4
5
6
7
8
9
|
module.exports = Ferdi => {
const getMessages = () => {
const totalNotifications = document.querySelectorAll('#notificationList > .notification').length;
const hasUnread = document.querySelectorAll('#notificationsButton.hasUnread').length > 0;
Ferdi.setBadge(hasUnread ? totalNotifications : 0);
};
Ferdi.loop(getMessages);
};
|