diff options
Diffstat (limited to 'recipes/rocketchat/webview.js')
-rw-r--r-- | recipes/rocketchat/webview.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/recipes/rocketchat/webview.js b/recipes/rocketchat/webview.js index 95ada6f..85b0c32 100644 --- a/recipes/rocketchat/webview.js +++ b/recipes/rocketchat/webview.js | |||
@@ -1,22 +1,22 @@ | |||
1 | 1 | ||
2 | module.exports = Ferdi => { | 2 | module.exports = Ferdium => { |
3 | const getMessages = () => { | 3 | const getMessages = () => { |
4 | const directMessages = document.querySelectorAll('.rcx-badge'); | 4 | const directMessages = document.querySelectorAll('.rcx-badge'); |
5 | 5 | ||
6 | let directMessagesCount = 0; | 6 | let directMessagesCount = 0; |
7 | 7 | ||
8 | for (const directMessage of directMessages) { | 8 | for (const directMessage of directMessages) { |
9 | directMessagesCount += Ferdi.safeParseInt(directMessage.textContent); | 9 | directMessagesCount += Ferdium.safeParseInt(directMessage.textContent); |
10 | } | 10 | } |
11 | 11 | ||
12 | const indirectMessagesCount = Math.round( | 12 | const indirectMessagesCount = Math.round( |
13 | document.querySelectorAll('.rcx-sidebar-item--highlighted').length, | 13 | document.querySelectorAll('.rcx-sidebar-item--highlighted').length, |
14 | ); | 14 | ); |
15 | 15 | ||
16 | Ferdi.setBadge(directMessagesCount, indirectMessagesCount); | 16 | Ferdium.setBadge(directMessagesCount, indirectMessagesCount); |
17 | }; | 17 | }; |
18 | 18 | ||
19 | Ferdi.loop(getMessages); | 19 | Ferdium.loop(getMessages); |
20 | 20 | ||
21 | const getTeamIcon = function getTeamIcon() { | 21 | const getTeamIcon = function getTeamIcon() { |
22 | const manifestElement = document.querySelector('link[rel="manifest"]'); | 22 | const manifestElement = document.querySelector('link[rel="manifest"]'); |
@@ -41,7 +41,7 @@ module.exports = Ferdi => { | |||
41 | const response = JSON.parse(this.responseText); | 41 | const response = JSON.parse(this.responseText); |
42 | 42 | ||
43 | if (response.icons.length > 0) { | 43 | if (response.icons.length > 0) { |
44 | Ferdi.setAvatarImage(`${window.location.protocol}//${window.location.host}${response.icons[0].src}`); | 44 | Ferdium.setAvatarImage(`${window.location.protocol}//${window.location.host}${response.icons[0].src}`); |
45 | } | 45 | } |
46 | }); | 46 | }); |
47 | 47 | ||