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/webview.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'recipes/plurk/webview.js') 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