diff options
Diffstat (limited to 'recipes/chatra')
-rw-r--r-- | recipes/chatra/index.js | 3 | ||||
-rw-r--r-- | recipes/chatra/package.json | 2 | ||||
-rw-r--r-- | recipes/chatra/webview.js | 11 |
3 files changed, 6 insertions, 10 deletions
diff --git a/recipes/chatra/index.js b/recipes/chatra/index.js index 46f936f..23607bd 100644 --- a/recipes/chatra/index.js +++ b/recipes/chatra/index.js | |||
@@ -1,2 +1 @@ | |||
1 | // just pass through Franz | module.exports = Ferdi => Ferdi; | |
2 | module.exports = Franz => Franz; | ||
diff --git a/recipes/chatra/package.json b/recipes/chatra/package.json index 482765f..3cea500 100644 --- a/recipes/chatra/package.json +++ b/recipes/chatra/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "chatra", | 2 | "id": "chatra", |
3 | "name": "chatra", | 3 | "name": "chatra", |
4 | "version": "1.0.2", | 4 | "version": "1.1.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://app.chatra.io/", | 7 | "serviceURL": "https://app.chatra.io/", |
diff --git a/recipes/chatra/webview.js b/recipes/chatra/webview.js index a8a611c..a82a78d 100644 --- a/recipes/chatra/webview.js +++ b/recipes/chatra/webview.js | |||
@@ -1,6 +1,4 @@ | |||
1 | const path = require('path'); | 1 | module.exports = (Ferdi) => { |
2 | |||
3 | module.exports = (Franz, options) => { | ||
4 | const getMessages = () => { | 2 | const getMessages = () => { |
5 | // get new conversations in My Queue | 3 | // get new conversations in My Queue |
6 | const myQueue = $('.super-nav a.super-nav__item.js-from-super-to-nav[href^="/chat/box:my"] .count').not('.count--gray').text(); | 4 | const myQueue = $('.super-nav a.super-nav__item.js-from-super-to-nav[href^="/chat/box:my"] .count').not('.count--gray').text(); |
@@ -8,12 +6,11 @@ module.exports = (Franz, options) => { | |||
8 | // get all missed conversations | 6 | // get all missed conversations |
9 | const missed = $('.super-nav a.super-nav__item.js-from-super-to-nav[href^="/chat/box:missed"] .count').text(); | 7 | const missed = $('.super-nav a.super-nav__item.js-from-super-to-nav[href^="/chat/box:missed"] .count').text(); |
10 | 8 | ||
11 | // set Franz badge | 9 | // set Ferdi badge |
12 | // myQueue => New conversations in My Queue | 10 | // myQueue => New conversations in My Queue |
13 | // missed => All missed conversations | 11 | // missed => All missed conversations |
14 | Franz.setBadge(myQueue, missed); | 12 | Ferdi.setBadge(myQueue, missed); |
15 | }; | 13 | }; |
16 | 14 | ||
17 | // check for new messages every second and update Franz badge | 15 | Ferdi.loop(getMessages); |
18 | Franz.loop(getMessages); | ||
19 | }; | 16 | }; |