aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/plurk/webview.js
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-08-31 16:25:57 +0530
committerLibravatar Vijay A <avijayr@protonmail.com>2021-08-31 16:25:57 +0530
commitdfae2d231e39c81827d08fd8834d736c5b3005b1 (patch)
tree5037b401e7de837fdd6046a3c61ac76aed240e6e /recipes/plurk/webview.js
parentNew recipe: odoo (diff)
downloadferdium-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/plurk/webview.js')
-rw-r--r--recipes/plurk/webview.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/recipes/plurk/webview.js b/recipes/plurk/webview.js
index 6f20458..0136c24 100644
--- a/recipes/plurk/webview.js
+++ b/recipes/plurk/webview.js
@@ -5,8 +5,11 @@ module.exports = Ferdi => {
5 const np = document.querySelector('#noti_np_count'); 5 const np = document.querySelector('#noti_np_count');
6 const re = document.querySelector('#noti_re_count'); 6 const re = document.querySelector('#noti_re_count');
7 7
8 if (np || re) { 8 if (np) {
9 direct = parseInt(np.innerHTML) + parseInt(re.innerHTML); 9 direct += Ferdi.safeParseInt(np.innerHTML);
10 }
11 if (re) {
12 direct += Ferdi.safeParseInt(re.innerHTML);
10 } 13 }
11 14
12 Ferdi.setBadge(direct); 15 Ferdi.setBadge(direct);