aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/element
diff options
context:
space:
mode:
authorLibravatar Iaroslav <yavoloh@mail.ru>2021-10-23 19:13:55 +0500
committerLibravatar GitHub <noreply@github.com>2021-10-23 19:43:55 +0530
commit591a9a4ca229dcda6e54d4e24f79dfef14d0acc5 (patch)
tree8676eb01fe567fb96c8220459746d55cc3dbf12a /recipes/element
parentfix for #286 with fallback (#738) (diff)
downloadferdium-recipes-591a9a4ca229dcda6e54d4e24f79dfef14d0acc5.tar.gz
ferdium-recipes-591a9a4ca229dcda6e54d4e24f79dfef14d0acc5.tar.zst
ferdium-recipes-591a9a4ca229dcda6e54d4e24f79dfef14d0acc5.zip
Add setDialogTitle feature to api, WhatsApp and Telegram (#750)
Co-authored-by: Vijay A <vraravam@users.noreply.github.com>
Diffstat (limited to 'recipes/element')
-rw-r--r--recipes/element/webview.js8
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);