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/whatsapp/package.json | 2 +- recipes/whatsapp/webview.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'recipes/whatsapp') diff --git a/recipes/whatsapp/package.json b/recipes/whatsapp/package.json index 360cc47..6d2a93e 100644 --- a/recipes/whatsapp/package.json +++ b/recipes/whatsapp/package.json @@ -1,7 +1,7 @@ { "id": "whatsapp", "name": "WhatsApp", - "version": "3.2.0", + "version": "3.2.1", "license": "MIT", "config": { "serviceURL": "https://web.whatsapp.com", diff --git a/recipes/whatsapp/webview.js b/recipes/whatsapp/webview.js index 773caa8..9b979d2 100644 --- a/recipes/whatsapp/webview.js +++ b/recipes/whatsapp/webview.js @@ -36,7 +36,7 @@ module.exports = Ferdi => { const chatElem = chatElems[i]; const unreadElem = chatElem.children[0].children[0].children[1].children[1].children[1]; - const countValue = parseInt(unreadElem.textContent) || 0; // Returns 0 in case of isNaN + const countValue = Ferdi.safeParseInt(unreadElem.textContent); if (unreadElem.querySelectorAll('[data-icon=muted]').length === 0) { count += countValue; -- cgit v1.2.3-70-g09d2