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/roundcube/package.json | 2 +- recipes/roundcube/webview.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'recipes/roundcube') diff --git a/recipes/roundcube/package.json b/recipes/roundcube/package.json index 2bd8dba..d36a816 100644 --- a/recipes/roundcube/package.json +++ b/recipes/roundcube/package.json @@ -1,7 +1,7 @@ { "id": "roundcube", "name": "Roundcube", - "version": "1.1.0", + "version": "1.1.1", "repository": "https://github.com/jonathanjuursema/franz-roundcube", "license": "MIT", "config": { diff --git a/recipes/roundcube/webview.js b/recipes/roundcube/webview.js index 8a2ffef..ce9872a 100644 --- a/recipes/roundcube/webview.js +++ b/recipes/roundcube/webview.js @@ -3,8 +3,7 @@ module.exports = Ferdi => { const directElements = document.querySelectorAll('.unreadcount'); let direct = 0; for (let i = 0; i < directElements.length; i += 1) { - const n = parseInt(directElements[i].innerHTML); - direct += isNaN(n) ? 0 : n; + direct += Ferdi.safeParseInt(directElements[i].innerHTML); } Ferdi.setBadge(direct); }; -- cgit v1.2.3-70-g09d2