aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/workplace
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/workplace
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/workplace')
-rw-r--r--recipes/workplace/package.json2
-rw-r--r--recipes/workplace/webview.js4
2 files changed, 3 insertions, 3 deletions
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 @@
1{ 1{
2 "id": "workplace", 2 "id": "workplace",
3 "name": "Workplace", 3 "name": "Workplace",
4 "version": "1.3.0", 4 "version": "1.3.1",
5 "license": "MIT", 5 "license": "MIT",
6 "config": { 6 "config": {
7 "serviceURL": "https://{teamId}.workplace.com/chat", 7 "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 => {
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;