aboutsummaryrefslogtreecommitdiffstats
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
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)
-rw-r--r--recipes/zoho/package.json2
-rw-r--r--recipes/zoho/webview-unsafe.js23
2 files changed, 13 insertions, 12 deletions
diff --git a/recipes/zoho/package.json b/recipes/zoho/package.json
index b1444d7..c393fe5 100644
--- a/recipes/zoho/package.json
+++ b/recipes/zoho/package.json
@@ -1,7 +1,7 @@
1{ 1{
2 "id": "zoho", 2 "id": "zoho",
3 "name": "Zoho Mail", 3 "name": "Zoho Mail",
4 "version": "1.4.0", 4 "version": "1.4.1",
5 "license": "MIT", 5 "license": "MIT",
6 "config": { 6 "config": {
7 "serviceURL": "https://www.zoho.com/mail/login.html", 7 "serviceURL": "https://www.zoho.com/mail/login.html",
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}