aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/zoho/webview-unsafe.js
diff options
context:
space:
mode:
authorLibravatar Edgars <eandersons@users.noreply.github.com>2023-11-25 20:41:24 +0200
committerLibravatar GitHub <noreply@github.com>2023-11-25 11:41:24 -0700
commit44d11975596afa72f1ffb67816c40bfd734a8262 (patch)
treea1389a4d4c57192f49a33ad4f5f0cf1a6f78dad6 /recipes/zoho/webview-unsafe.js
parentFixed formatting of discord recipe (diff)
downloadferdium-recipes-44d11975596afa72f1ffb67816c40bfd734a8262.tar.gz
ferdium-recipes-44d11975596afa72f1ffb67816c40bfd734a8262.tar.zst
ferdium-recipes-44d11975596afa72f1ffb67816c40bfd734a8262.zip
Fix Zoho Mail badge (#466)
Diffstat (limited to 'recipes/zoho/webview-unsafe.js')
-rw-r--r--recipes/zoho/webview-unsafe.js23
1 files changed, 12 insertions, 11 deletions
diff --git a/recipes/zoho/webview-unsafe.js b/recipes/zoho/webview-unsafe.js
index df5237b..077e8f8 100644
--- a/recipes/zoho/webview-unsafe.js
+++ b/recipes/zoho/webview-unsafe.js
@@ -1,12 +1,13 @@
1// wait for Ferdium and Zoho Mail to initialize 1// Wait for Ferdium to initialize
2if ( 2if (window.ferdium?.setBadge !== undefined) {
3 Object.prototype.hasOwnProperty.call(window, 'ferdium') && 3 window.ferdium.setBadge(
4 Object.prototype.hasOwnProperty.call(window.ferdium, 'setBadge') && 4 window.ferdium.safeParseInt(window.zmfolAction?.getUnreadViewCount()) +
5 Object.prototype.hasOwnProperty.call(window, 'zmNCenter') && 5 window.ferdium.safeParseInt(
6 Object.prototype.hasOwnProperty.call(window, 'zmfolAction') 6 document.querySelector('#wms_menu_unreadchats_cnt')?.textContent,
7) { 7 ),
8 const unreadNotifications = window.zmNCenter.counter.count(); // General Notifications by Zoho (Bell Icon) 8 window.ferdium.safeParseInt(
9 const unreadMail = window.zmfolAction.getUnreadViewCount(); // Unread messages count 9 window.zmTopBar?.topBandElements()?.notification?.children
10 10 ?.notificationBadge?.textContent,
11 window.ferdium.setBadge(unreadMail, unreadNotifications); 11 ),
12 );
12} 13}