diff options
Diffstat (limited to 'recipes/slite')
-rw-r--r-- | recipes/slite/package.json | 2 | ||||
-rw-r--r-- | recipes/slite/webview.js | 12 |
2 files changed, 3 insertions, 11 deletions
diff --git a/recipes/slite/package.json b/recipes/slite/package.json index 5c38982..44ec123 100644 --- a/recipes/slite/package.json +++ b/recipes/slite/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "slite", | 2 | "id": "slite", |
3 | "name": "Slite", | 3 | "name": "Slite", |
4 | "version": "1.0.3", | 4 | "version": "1.0.4", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://{teamId}.slite.com", | 7 | "serviceURL": "https://{teamId}.slite.com", |
diff --git a/recipes/slite/webview.js b/recipes/slite/webview.js index d892c3c..a044399 100644 --- a/recipes/slite/webview.js +++ b/recipes/slite/webview.js | |||
@@ -1,15 +1,7 @@ | |||
1 | const getInnerInt = selector => { | ||
2 | const element = document.querySelector(selector); | ||
3 | return element && parseInt(element.innerText); | ||
4 | }; | ||
5 | |||
6 | module.exports = Ferdi => { | 1 | module.exports = Ferdi => { |
7 | const getMessages = function getMessages() { | 2 | const getMessages = function getMessages() { |
8 | const direct = ( | 3 | const element = document.querySelector("#app button[data-test-id='notificationsCount']"); |
9 | getInnerInt("#app button[data-test-id='notificationsCount']") || 0 | 4 | Ferdi.setBadge(element ? Ferdi.safeParseInt(element.innerText) : 0); |
10 | ); | ||
11 | |||
12 | Ferdi.setBadge(direct); | ||
13 | }; | 5 | }; |
14 | 6 | ||
15 | Ferdi.loop(getMessages); | 7 | Ferdi.loop(getMessages); |