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/jira/webview.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'recipes/jira/webview.js') diff --git a/recipes/jira/webview.js b/recipes/jira/webview.js index f52235d..d39f91e 100644 --- a/recipes/jira/webview.js +++ b/recipes/jira/webview.js @@ -2,10 +2,7 @@ module.exports = (Ferdi) => { const getMessages = function getMessages() { // get unread messages const element = document.querySelector('#atlassian-navigation-notification-count span'); - let count = element ? element.innerText : 0; - count = parseInt(count, 10); - - Ferdi.setBadge(count); + Ferdi.setBadge(element ? element.innerText : 0); }; Ferdi.loop(getMessages); -- cgit v1.2.3-70-g09d2