aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/zendesk/webview.js
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-08-31 16:25:57 +0530
committerLibravatar Vijay A <avijayr@protonmail.com>2021-08-31 16:25:57 +0530
commitdfae2d231e39c81827d08fd8834d736c5b3005b1 (patch)
tree5037b401e7de837fdd6046a3c61ac76aed240e6e /recipes/zendesk/webview.js
parentNew recipe: odoo (diff)
downloadferdium-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/zendesk/webview.js')
-rw-r--r--recipes/zendesk/webview.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/recipes/zendesk/webview.js b/recipes/zendesk/webview.js
index 8bc58ac..b781121 100644
--- a/recipes/zendesk/webview.js
+++ b/recipes/zendesk/webview.js
@@ -5,10 +5,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
5module.exports = Ferdi => { 5module.exports = Ferdi => {
6 const getMessages = () => { 6 const getMessages = () => {
7 let count = 0; 7 let count = 0;
8 const el = document.querySelector('.dashboard-top-panel .indicators .stats-group .cell-value'); 8 const element = document.querySelector('.dashboard-top-panel .indicators .stats-group .cell-value');
9 9 if (element) {
10 if (el) { 10 count = Ferdi.safeParseInt(element.innerHTML);
11 count = parseInt(el.innerHTML, 10);
12 } 11 }
13 12
14 Ferdi.setBadge(count); 13 Ferdi.setBadge(count);