diff options
author | Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com> | 2021-08-27 18:13:24 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-27 18:13:24 +0530 |
commit | 155c4b832281348c16be1f4ef667e6e23dbf1bd8 (patch) | |
tree | d144e2de2e6c7fb2e334246e8a4aecdbeb08ef8d /recipes/campuswire/webview.js | |
parent | docs: fixed template file for creating recipe. (diff) | |
download | ferdium-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/campuswire/webview.js')
-rw-r--r-- | recipes/campuswire/webview.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/recipes/campuswire/webview.js b/recipes/campuswire/webview.js index b65f25a..5f43cbb 100644 --- a/recipes/campuswire/webview.js +++ b/recipes/campuswire/webview.js | |||
@@ -1,4 +1,4 @@ | |||
1 | module.exports = Franz => { | 1 | module.exports = Ferdi => { |
2 | const getMessages = function getMessages() { | 2 | const getMessages = function getMessages() { |
3 | let count = document.querySelectorAll('._5fx8:not(._569x),._1ht3:not(._569x)').length; | 3 | let count = document.querySelectorAll('._5fx8:not(._569x),._1ht3:not(._569x)').length; |
4 | const messageRequestsElement = document.querySelector('._5nxf'); | 4 | const messageRequestsElement = document.querySelector('._5nxf'); |
@@ -7,17 +7,18 @@ module.exports = Franz => { | |||
7 | count += parseInt(messageRequestsElement.innerHTML, 10); | 7 | count += parseInt(messageRequestsElement.innerHTML, 10); |
8 | } | 8 | } |
9 | 9 | ||
10 | Franz.setBadge(count); | 10 | Ferdi.setBadge(count); |
11 | }; | 11 | }; |
12 | 12 | ||
13 | Franz.loop(getMessages); | 13 | Ferdi.loop(getMessages); |
14 | |||
14 | localStorage.setItem('_cs_desktopNotifsEnabled', JSON.stringify({ | 15 | localStorage.setItem('_cs_desktopNotifsEnabled', JSON.stringify({ |
15 | __t: new Date().getTime(), | 16 | __t: new Date().getTime(), |
16 | __v: true, | 17 | __v: true, |
17 | })); | 18 | })); |
18 | 19 | ||
19 | if (typeof Franz.onNotify === 'function') { | 20 | if (typeof Ferdi.onNotify === 'function') { |
20 | Franz.onNotify(notification => { | 21 | Ferdi.onNotify(notification => { |
21 | if (typeof notification.title !== 'string') { | 22 | if (typeof notification.title !== 'string') { |
22 | notification.title = ((notification.title.props || {}).content || [])[0] || 'Campuswire'; | 23 | notification.title = ((notification.title.props || {}).content || [])[0] || 'Campuswire'; |
23 | } | 24 | } |