aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/gmail/webview.js
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-08-31 16:25:57 +0530
committerLibravatar Vijay A <avijayr@protonmail.com>2021-08-31 16:25:57 +0530
commitdfae2d231e39c81827d08fd8834d736c5b3005b1 (patch)
tree5037b401e7de837fdd6046a3c61ac76aed240e6e /recipes/gmail/webview.js
parentNew recipe: odoo (diff)
downloadferdium-recipes-dfae2d231e39c81827d08fd8834d736c5b3005b1.tar.gz
ferdium-recipes-dfae2d231e39c81827d08fd8834d736c5b3005b1.tar.zst
ferdium-recipes-dfae2d231e39c81827d08fd8834d736c5b3005b1.zip
refactor: Use Ferdi.safeParseInt to ensure that parsing is done consistently in all recipes.
Diffstat (limited to 'recipes/gmail/webview.js')
-rw-r--r--recipes/gmail/webview.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/recipes/gmail/webview.js b/recipes/gmail/webview.js
index 9a09c87..8c78bb6 100644
--- a/recipes/gmail/webview.js
+++ b/recipes/gmail/webview.js
@@ -13,10 +13,9 @@ module.exports = (Ferdi) => {
13 13
14 const inboxLinks = document.getElementsByClassName('J-Ke n0'); 14 const inboxLinks = document.getElementsByClassName('J-Ke n0');
15 if (inboxLinks.length > 0) { 15 if (inboxLinks.length > 0) {
16 const inboxLink = inboxLinks[0]; 16 const unreadCounts = inboxLinks[0].parentNode.parentNode.getElementsByClassName('bsU');
17 const unreadCounts = inboxLink.parentNode.parentNode.getElementsByClassName('bsU');
18 if (unreadCounts.length > 0) { 17 if (unreadCounts.length > 0) {
19 count = parseInt(unreadCounts[0].innerHTML.trim(), 10); 18 count = Ferdi.safeParseInt(unreadCounts[0].innerHTML);
20 } 19 }
21 } 20 }
22 21