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/workplace/package.json | 2 +- recipes/workplace/webview.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'recipes/workplace') diff --git a/recipes/workplace/package.json b/recipes/workplace/package.json index 61e317c..f730dd8 100644 --- a/recipes/workplace/package.json +++ b/recipes/workplace/package.json @@ -1,7 +1,7 @@ { "id": "workplace", "name": "Workplace", - "version": "1.3.0", + "version": "1.3.1", "license": "MIT", "config": { "serviceURL": "https://{teamId}.workplace.com/chat", diff --git a/recipes/workplace/webview.js b/recipes/workplace/webview.js index e10c449..efa5e2a 100644 --- a/recipes/workplace/webview.js +++ b/recipes/workplace/webview.js @@ -10,7 +10,7 @@ module.exports = Ferdi => { const notifications = document.querySelector('#notifications span span'); if (notifications) { - indirect = parseInt(notifications.innerText, 10); + indirect = Ferdi.safeParseInt(notifications.innerText); } if (chatsElement) { @@ -18,7 +18,7 @@ module.exports = Ferdi => { const chatMessages = chatsElement.querySelector('span'); if (chatMessages) { - direct = parseInt(chatMessages.innerText, 10); + direct = Ferdi.safeParseInt(chatMessages.innerText); } } else { direct = document.querySelectorAll('[data-pagelet="WorkGalahadChannel"] .uiList [role="gridcell"] [role="button"] .oxk9n0fw').length; -- cgit v1.2.3-70-g09d2