diff options
author | Vijay A <avijayr@protonmail.com> | 2021-08-31 16:25:57 +0530 |
---|---|---|
committer | Vijay A <avijayr@protonmail.com> | 2021-08-31 16:25:57 +0530 |
commit | dfae2d231e39c81827d08fd8834d736c5b3005b1 (patch) | |
tree | 5037b401e7de837fdd6046a3c61ac76aed240e6e /recipes/workplace/webview.js | |
parent | New recipe: odoo (diff) | |
download | ferdium-recipes-dfae2d231e39c81827d08fd8834d736c5b3005b1.tar.gz ferdium-recipes-dfae2d231e39c81827d08fd8834d736c5b3005b1.tar.zst ferdium-recipes-dfae2d231e39c81827d08fd8834d736c5b3005b1.zip |
refactor: Use Ferdi.safeParseInt to ensure that parsing is done consistently in all recipes.
Diffstat (limited to 'recipes/workplace/webview.js')
-rw-r--r-- | recipes/workplace/webview.js | 4 |
1 files changed, 2 insertions, 2 deletions
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 => { | |||
10 | const notifications = document.querySelector('#notifications span span'); | 10 | const notifications = document.querySelector('#notifications span span'); |
11 | 11 | ||
12 | if (notifications) { | 12 | if (notifications) { |
13 | indirect = parseInt(notifications.innerText, 10); | 13 | indirect = Ferdi.safeParseInt(notifications.innerText); |
14 | } | 14 | } |
15 | 15 | ||
16 | if (chatsElement) { | 16 | if (chatsElement) { |
@@ -18,7 +18,7 @@ module.exports = Ferdi => { | |||
18 | const chatMessages = chatsElement.querySelector('span'); | 18 | const chatMessages = chatsElement.querySelector('span'); |
19 | 19 | ||
20 | if (chatMessages) { | 20 | if (chatMessages) { |
21 | direct = parseInt(chatMessages.innerText, 10); | 21 | direct = Ferdi.safeParseInt(chatMessages.innerText); |
22 | } | 22 | } |
23 | } else { | 23 | } else { |
24 | direct = document.querySelectorAll('[data-pagelet="WorkGalahadChannel"] .uiList [role="gridcell"] [role="button"] .oxk9n0fw').length; | 24 | direct = document.querySelectorAll('[data-pagelet="WorkGalahadChannel"] .uiList [role="gridcell"] [role="button"] .oxk9n0fw').length; |