diff options
Diffstat (limited to 'recipes/zoho/webview-unsafe.js')
-rw-r--r-- | recipes/zoho/webview-unsafe.js | 23 |
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 |
2 | if ( | 2 | if (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 | } |