aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/chatra/webview.js
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/chatra/webview.js')
-rw-r--r--recipes/chatra/webview.js11
1 files changed, 4 insertions, 7 deletions
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 @@
1const path = require('path'); 1module.exports = (Ferdi) => {
2
3module.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};