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/plurk/package.json | 2 +- recipes/plurk/webview.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'recipes/plurk') 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 @@ { "id": "plurk", "name": "Plurk", - "version": "1.1.0", + "version": "1.1.1", "license": "MIT", "config": { "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 => { const np = document.querySelector('#noti_np_count'); const re = document.querySelector('#noti_re_count'); - if (np || re) { - direct = parseInt(np.innerHTML) + parseInt(re.innerHTML); + if (np) { + direct += Ferdi.safeParseInt(np.innerHTML); + } + if (re) { + direct += Ferdi.safeParseInt(re.innerHTML); } Ferdi.setBadge(direct); -- cgit v1.2.3-70-g09d2