diff options
author | 2021-08-31 16:25:57 +0530 | |
---|---|---|
committer | 2021-08-31 16:25:57 +0530 | |
commit | dfae2d231e39c81827d08fd8834d736c5b3005b1 (patch) | |
tree | 5037b401e7de837fdd6046a3c61ac76aed240e6e /recipes/plurk | |
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/plurk')
-rw-r--r-- | recipes/plurk/package.json | 2 | ||||
-rw-r--r-- | recipes/plurk/webview.js | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/recipes/plurk/package.json b/recipes/plurk/package.json index 717c64e..6167c53 100644 --- a/recipes/plurk/package.json +++ b/recipes/plurk/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "plurk", | 2 | "id": "plurk", |
3 | "name": "Plurk", | 3 | "name": "Plurk", |
4 | "version": "1.1.0", | 4 | "version": "1.1.1", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.plurk.com" | 7 | "serviceURL": "https://www.plurk.com" |
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); |