diff options
author | 2021-08-31 16:25:57 +0530 | |
---|---|---|
committer | 2021-08-31 16:25:57 +0530 | |
commit | dfae2d231e39c81827d08fd8834d736c5b3005b1 (patch) | |
tree | 5037b401e7de837fdd6046a3c61ac76aed240e6e /recipes/zendesk | |
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/zendesk')
-rw-r--r-- | recipes/zendesk/package.json | 2 | ||||
-rw-r--r-- | recipes/zendesk/webview.js | 7 |
2 files changed, 4 insertions, 5 deletions
diff --git a/recipes/zendesk/package.json b/recipes/zendesk/package.json index 922195b..18e11e0 100644 --- a/recipes/zendesk/package.json +++ b/recipes/zendesk/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "zendesk", | 2 | "id": "zendesk", |
3 | "name": "zendesk", | 3 | "name": "zendesk", |
4 | "version": "1.1.0", | 4 | "version": "1.1.1", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://{teamId}.zendesk.com/agent", | 7 | "serviceURL": "https://{teamId}.zendesk.com/agent", |
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 | |||
5 | module.exports = Ferdi => { | 5 | module.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); |