diff options
Diffstat (limited to 'recipes/gmail/webview.js')
-rw-r--r-- | recipes/gmail/webview.js | 5 |
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 | ||