diff options
Diffstat (limited to 'recipes/element')
-rw-r--r-- | recipes/element/webview.js | 8 |
1 files changed, 4 insertions, 4 deletions
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 => { | |||
9 | let indirectCount = 0; | 9 | let indirectCount = 0; |
10 | // Count Badges depending on Element Settings | 10 | // Count Badges depending on Element Settings |
11 | if (avatarBadges.length > 0) { | 11 | if (avatarBadges.length > 0) { |
12 | avatarBadges.forEach(function(badge) { | 12 | for (const badge of avatarBadges) { |
13 | if (badge.parentElement.getAttribute('class').includes('mx_NotificationBadge_highlighted')) { | 13 | if (badge.parentElement.getAttribute('class').includes('mx_NotificationBadge_highlighted')) { |
14 | directCount = directCount + Ferdi.safeParseInt(badge.textContent); | 14 | directCount = directCount + Ferdi.safeParseInt(badge.textContent); |
15 | } else if (badge.parentElement.previousSibling != null && badge.parentElement.previousSibling.getAttribute('class').includes('mx_DecoratedRoomAvatar_icon_online')) { | 15 | } else if (badge.parentElement.previousSibling != null && badge.parentElement.previousSibling.getAttribute('class').includes('mx_DecoratedRoomAvatar_icon_online')) { |
@@ -19,9 +19,9 @@ module.exports = Ferdi => { | |||
19 | } else { | 19 | } else { |
20 | indirectCount = indirectCount + Ferdi.safeParseInt(badge.textContent); | 20 | indirectCount = indirectCount + Ferdi.safeParseInt(badge.textContent); |
21 | } | 21 | } |
22 | }); | 22 | } |
23 | } else { | 23 | } else { |
24 | spaceBadges.forEach(function(badge) { | 24 | for (const badge of spaceBadges) { |
25 | if (badge.parentElement.getAttribute('class').includes('mx_NotificationBadge_highlighted')) { | 25 | if (badge.parentElement.getAttribute('class').includes('mx_NotificationBadge_highlighted')) { |
26 | directCount = directCount + Ferdi.safeParseInt(badge.textContent); | 26 | directCount = directCount + Ferdi.safeParseInt(badge.textContent); |
27 | } else if (badge.parentElement.getAttribute('class').includes('mx_NotificationBadge_dot')) { | 27 | } else if (badge.parentElement.getAttribute('class').includes('mx_NotificationBadge_dot')) { |
@@ -29,7 +29,7 @@ module.exports = Ferdi => { | |||
29 | } else { | 29 | } else { |
30 | indirectCount = indirectCount + Ferdi.safeParseInt(badge.textContent); | 30 | indirectCount = indirectCount + Ferdi.safeParseInt(badge.textContent); |
31 | } | 31 | } |
32 | }); | 32 | } |
33 | } | 33 | } |
34 | // set Ferdi badge | 34 | // set Ferdi badge |
35 | Ferdi.setBadge(directCount, indirectCount); | 35 | Ferdi.setBadge(directCount, indirectCount); |