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/package.json | 2 +- recipes/jira/webview.js | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'recipes/jira') diff --git a/recipes/jira/package.json b/recipes/jira/package.json index 09ace99..23d77a1 100644 --- a/recipes/jira/package.json +++ b/recipes/jira/package.json @@ -1,7 +1,7 @@ { "id": "jira", "name": "Jira", - "version": "1.3.0", + "version": "1.3.1", "license": "MIT", "config": { "serviceURL": "https://{teamId}.atlassian.net", 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