blob: 6439c2c27cba8e8dfe2d6a6e9931f019193a833e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
|
module.exports = Ferdi => {
const getMessages = () => {
const directCountSelector = [...document.querySelectorAll('[data-region="count-container"]')];
const totalMessageCount = directCountSelector.reduce(
((count, item) => count + Ferdi.safeParseInt(item.textContent)),
0
);
Ferdi.setBadge(totalMessageCount, 0);
};
Ferdi.loop(getMessages);
};
|