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/roundcube/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/roundcube/webview.js')
-rw-r--r-- | recipes/roundcube/webview.js | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/recipes/roundcube/webview.js b/recipes/roundcube/webview.js index 8a2ffef..ce9872a 100644 --- a/recipes/roundcube/webview.js +++ b/recipes/roundcube/webview.js | |||
@@ -3,8 +3,7 @@ module.exports = Ferdi => { | |||
3 | const directElements = document.querySelectorAll('.unreadcount'); | 3 | const directElements = document.querySelectorAll('.unreadcount'); |
4 | let direct = 0; | 4 | let direct = 0; |
5 | for (let i = 0; i < directElements.length; i += 1) { | 5 | for (let i = 0; i < directElements.length; i += 1) { |
6 | const n = parseInt(directElements[i].innerHTML); | 6 | direct += Ferdi.safeParseInt(directElements[i].innerHTML); |
7 | direct += isNaN(n) ? 0 : n; | ||
8 | } | 7 | } |
9 | Ferdi.setBadge(direct); | 8 | Ferdi.setBadge(direct); |
10 | }; | 9 | }; |