diff options
Diffstat (limited to 'recipes/canvas')
-rw-r--r-- | recipes/canvas/index.js | 2 | ||||
-rw-r--r-- | recipes/canvas/webview.js | 9 |
2 files changed, 4 insertions, 7 deletions
diff --git a/recipes/canvas/index.js b/recipes/canvas/index.js index 415aeea..23607bd 100644 --- a/recipes/canvas/index.js +++ b/recipes/canvas/index.js | |||
@@ -1 +1 @@ | |||
module.exports = Ferdi => Ferdi; \ No newline at end of file | module.exports = Ferdi => Ferdi; | ||
diff --git a/recipes/canvas/webview.js b/recipes/canvas/webview.js index 59d37e3..1bd3c84 100644 --- a/recipes/canvas/webview.js +++ b/recipes/canvas/webview.js | |||
@@ -1,17 +1,14 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | module.exports = Ferdi => { | 1 | module.exports = Ferdi => { |
4 | const getMessages = () => { | 2 | const getMessages = () => { |
5 | var direct = 0; | 3 | let direct = 0; |
6 | 4 | ||
7 | const MessageElement = document.querySelector('[id=global_nav_conversations_link]'); | 5 | const MessageElement = document.querySelector('[id=global_nav_conversations_link]'); |
8 | if (MessageElement) { | 6 | if (MessageElement) { |
9 | direct += MessageElement.innerHTML; | 7 | direct += MessageElement.innerHTML; |
10 | } | 8 | } |
11 | 9 | ||
12 | Ferdi.setBadge(direct); | 10 | Ferdi.setBadge(direct); |
13 | }; | 11 | }; |
14 | 12 | ||
15 | Ferdi.loop(getMessages); | 13 | Ferdi.loop(getMessages); |
16 | 14 | }; | |
17 | }; \ No newline at end of file | ||