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/wrike/webview.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'recipes/wrike/webview.js') diff --git a/recipes/wrike/webview.js b/recipes/wrike/webview.js index be80318..39e293d 100644 --- a/recipes/wrike/webview.js +++ b/recipes/wrike/webview.js @@ -2,9 +2,8 @@ module.exports = (Ferdi) => { function getMessages() { let directCount = 0; const element = document.querySelector('.ws-navigation-button__indicator.ws-navigation-button-indicator'); - - if (element && element.innerText) { - directCount = parseInt(element.innerText); + if (element) { + directCount = Ferdi.safeParseInt(element.innerText); } Ferdi.setBadge(directCount); -- cgit v1.2.3-70-g09d2