diff options
Diffstat (limited to 'recipes/nextcloud-talk/webview.js')
-rw-r--r-- | recipes/nextcloud-talk/webview.js | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/recipes/nextcloud-talk/webview.js b/recipes/nextcloud-talk/webview.js index 0dfb6ea..12c2230 100644 --- a/recipes/nextcloud-talk/webview.js +++ b/recipes/nextcloud-talk/webview.js | |||
@@ -1,6 +1,4 @@ | |||
1 | "use strict"; | 1 | const _path = _interopRequireDefault(require('path')); |
2 | |||
3 | var _path = _interopRequireDefault(require("path")); | ||
4 | 2 | ||
5 | function _interopRequireDefault(obj) { | 3 | function _interopRequireDefault(obj) { |
6 | return obj && obj.__esModule ? obj : { default: obj }; | 4 | return obj && obj.__esModule ? obj : { default: obj }; |
@@ -10,21 +8,21 @@ module.exports = Ferdi => { | |||
10 | const getMessages = function getMessages() { | 8 | const getMessages = function getMessages() { |
11 | let direct = 0; | 9 | let direct = 0; |
12 | const notificationWrapper = document.querySelector( | 10 | const notificationWrapper = document.querySelector( |
13 | '.notifications .notification-wrapper' | 11 | '.notifications .notification-wrapper', |
14 | ); | 12 | ); |
15 | 13 | ||
16 | if (notificationWrapper) { | 14 | if (notificationWrapper) { |
17 | direct = notificationWrapper.querySelectorAll( | 15 | direct = notificationWrapper.querySelectorAll( |
18 | '.notification[object_type="chat"], .notification[object_type="room"' | 16 | '.notification[object_type="chat"], .notification[object_type="room"', |
19 | ).length; | 17 | ).length; |
20 | } | 18 | } |
21 | 19 | ||
22 | let indirect = 0; | 20 | let indirect = 0; |
23 | 21 | ||
24 | document.querySelectorAll('.app-navigation-entry__counter').forEach( | 22 | document.querySelectorAll('.app-navigation-entry__counter').forEach( |
25 | function(counter) { | 23 | (counter) => { |
26 | indirect += Number(counter.textContent); | 24 | indirect += Number(counter.textContent); |
27 | } | 25 | }, |
28 | ); | 26 | ); |
29 | Ferdi.setBadge(direct, indirect); | 27 | Ferdi.setBadge(direct, indirect); |
30 | }; | 28 | }; |