diff options
author | 2021-08-31 16:25:57 +0530 | |
---|---|---|
committer | 2021-08-31 16:25:57 +0530 | |
commit | dfae2d231e39c81827d08fd8834d736c5b3005b1 (patch) | |
tree | 5037b401e7de837fdd6046a3c61ac76aed240e6e /recipes/gmail | |
parent | New recipe: odoo (diff) | |
download | ferdium-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')
-rw-r--r-- | recipes/gmail/package.json | 2 | ||||
-rw-r--r-- | recipes/gmail/webview.js | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/recipes/gmail/package.json b/recipes/gmail/package.json index 49fc89f..97029b4 100644 --- a/recipes/gmail/package.json +++ b/recipes/gmail/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "gmail", | 2 | "id": "gmail", |
3 | "name": "Gmail", | 3 | "name": "Gmail", |
4 | "version": "1.4.0", | 4 | "version": "1.4.1", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://mail.google.com" | 7 | "serviceURL": "https://mail.google.com" |
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 | ||