From dfae2d231e39c81827d08fd8834d736c5b3005b1 Mon Sep 17 00:00:00 2001 From: Vijay A Date: Tue, 31 Aug 2021 16:25:57 +0530 Subject: refactor: Use Ferdi.safeParseInt to ensure that parsing is done consistently in all recipes. --- recipes/gmail/package.json | 2 +- recipes/gmail/webview.js | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'recipes/gmail') 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 @@ { "id": "gmail", "name": "Gmail", - "version": "1.4.0", + "version": "1.4.1", "license": "MIT", "config": { "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) => { const inboxLinks = document.getElementsByClassName('J-Ke n0'); if (inboxLinks.length > 0) { - const inboxLink = inboxLinks[0]; - const unreadCounts = inboxLink.parentNode.parentNode.getElementsByClassName('bsU'); + const unreadCounts = inboxLinks[0].parentNode.parentNode.getElementsByClassName('bsU'); if (unreadCounts.length > 0) { - count = parseInt(unreadCounts[0].innerHTML.trim(), 10); + count = Ferdi.safeParseInt(unreadCounts[0].innerHTML); } } -- cgit v1.2.3-70-g09d2