aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/chatra/webview.js
diff options
context:
space:
mode:
authorLibravatar Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com>2021-08-27 18:13:24 +0530
committerLibravatar GitHub <noreply@github.com>2021-08-27 18:13:24 +0530
commit155c4b832281348c16be1f4ef667e6e23dbf1bd8 (patch)
treed144e2de2e6c7fb2e334246e8a4aecdbeb08ef8d /recipes/chatra/webview.js
parentdocs: fixed template file for creating recipe. (diff)
downloadferdium-recipes-155c4b832281348c16be1f4ef667e6e23dbf1bd8.tar.gz
ferdium-recipes-155c4b832281348c16be1f4ef667e6e23dbf1bd8.tar.zst
ferdium-recipes-155c4b832281348c16be1f4ef667e6e23dbf1bd8.zip
chore: normalized all recipes to ensure compatibility with es6 (#639)
- Removed some calls to set badge with '0' all the time. - Removed all 'sourceMaps' since they are all outdated atm.
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};