1 2 3 4 5 6 7 8 9
module.exports = Ferdium => { const getMessages = () => { // Count number of conversations or teams with unread messages const count = document.querySelectorAll('.unread-count').length; Ferdium.setBadge(count, 0); }; Ferdium.loop(getMessages); };