diff options
author | Vijay A <avijayr@protonmail.com> | 2021-08-31 16:25:57 +0530 |
---|---|---|
committer | Vijay A <avijayr@protonmail.com> | 2021-08-31 16:25:57 +0530 |
commit | dfae2d231e39c81827d08fd8834d736c5b3005b1 (patch) | |
tree | 5037b401e7de837fdd6046a3c61ac76aed240e6e /recipes/whatsapp/webview.js | |
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/whatsapp/webview.js')
-rw-r--r-- | recipes/whatsapp/webview.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/recipes/whatsapp/webview.js b/recipes/whatsapp/webview.js index 773caa8..9b979d2 100644 --- a/recipes/whatsapp/webview.js +++ b/recipes/whatsapp/webview.js | |||
@@ -36,7 +36,7 @@ module.exports = Ferdi => { | |||
36 | const chatElem = chatElems[i]; | 36 | const chatElem = chatElems[i]; |
37 | const unreadElem = chatElem.children[0].children[0].children[1].children[1].children[1]; | 37 | const unreadElem = chatElem.children[0].children[0].children[1].children[1].children[1]; |
38 | 38 | ||
39 | const countValue = parseInt(unreadElem.textContent) || 0; // Returns 0 in case of isNaN | 39 | const countValue = Ferdi.safeParseInt(unreadElem.textContent); |
40 | 40 | ||
41 | if (unreadElem.querySelectorAll('[data-icon=muted]').length === 0) { | 41 | if (unreadElem.querySelectorAll('[data-icon=muted]').length === 0) { |
42 | count += countValue; | 42 | count += countValue; |