From 591a9a4ca229dcda6e54d4e24f79dfef14d0acc5 Mon Sep 17 00:00:00 2001 From: Iaroslav Date: Sat, 23 Oct 2021 19:13:55 +0500 Subject: Add setDialogTitle feature to api, WhatsApp and Telegram (#750) Co-authored-by: Vijay A --- recipes/element/webview.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'recipes/element') diff --git a/recipes/element/webview.js b/recipes/element/webview.js index 771c758..75df4d9 100644 --- a/recipes/element/webview.js +++ b/recipes/element/webview.js @@ -9,7 +9,7 @@ module.exports = Ferdi => { let indirectCount = 0; // Count Badges depending on Element Settings if (avatarBadges.length > 0) { - avatarBadges.forEach(function(badge) { + for (const badge of avatarBadges) { if (badge.parentElement.getAttribute('class').includes('mx_NotificationBadge_highlighted')) { directCount = directCount + Ferdi.safeParseInt(badge.textContent); } else if (badge.parentElement.previousSibling != null && badge.parentElement.previousSibling.getAttribute('class').includes('mx_DecoratedRoomAvatar_icon_online')) { @@ -19,9 +19,9 @@ module.exports = Ferdi => { } else { indirectCount = indirectCount + Ferdi.safeParseInt(badge.textContent); } - }); + } } else { - spaceBadges.forEach(function(badge) { + for (const badge of spaceBadges) { if (badge.parentElement.getAttribute('class').includes('mx_NotificationBadge_highlighted')) { directCount = directCount + Ferdi.safeParseInt(badge.textContent); } else if (badge.parentElement.getAttribute('class').includes('mx_NotificationBadge_dot')) { @@ -29,7 +29,7 @@ module.exports = Ferdi => { } else { indirectCount = indirectCount + Ferdi.safeParseInt(badge.textContent); } - }); + } } // set Ferdi badge Ferdi.setBadge(directCount, indirectCount); -- cgit v1.2.3-70-g09d2