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/webview.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'recipes/gmail/webview.js') 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