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/wrike/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/wrike/webview.js')
-rw-r--r-- | recipes/wrike/webview.js | 5 |
1 files changed, 2 insertions, 3 deletions
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) => { | |||
2 | function getMessages() { | 2 | function getMessages() { |
3 | let directCount = 0; | 3 | let directCount = 0; |
4 | const element = document.querySelector('.ws-navigation-button__indicator.ws-navigation-button-indicator'); | 4 | const element = document.querySelector('.ws-navigation-button__indicator.ws-navigation-button-indicator'); |
5 | 5 | if (element) { | |
6 | if (element && element.innerText) { | 6 | directCount = Ferdi.safeParseInt(element.innerText); |
7 | directCount = parseInt(element.innerText); | ||
8 | } | 7 | } |
9 | 8 | ||
10 | Ferdi.setBadge(directCount); | 9 | Ferdi.setBadge(directCount); |