diff options
Diffstat (limited to 'recipes/nextcloud-talk/webview.js')
-rw-r--r-- | recipes/nextcloud-talk/webview.js | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/recipes/nextcloud-talk/webview.js b/recipes/nextcloud-talk/webview.js index c180d4d..42b1e49 100644 --- a/recipes/nextcloud-talk/webview.js +++ b/recipes/nextcloud-talk/webview.js | |||
@@ -6,13 +6,24 @@ function _interopRequireDefault(obj) { | |||
6 | return obj && obj.__esModule ? obj : { default: obj }; | 6 | return obj && obj.__esModule ? obj : { default: obj }; |
7 | } | 7 | } |
8 | 8 | ||
9 | module.exports = Franz => { | 9 | module.exports = Ferdi => { |
10 | const getMessages = function getMessages() { | 10 | const getMessages = function getMessages() { |
11 | const direct = document.querySelectorAll('.app-navigation-entry-utils-counter.highlighted').length; | 11 | const direct = document.querySelector( |
12 | const indirect = document.querySelectorAll('.app-navigation-entry-utils-counter:not(.highlighted)').length; | 12 | '.notifications .notification-wrapper' |
13 | Franz.setBadge(direct, indirect); | 13 | ).querySelectorAll( |
14 | '.notification[object_type="chat"], .notification[object_type="room"' | ||
15 | ).length; | ||
16 | |||
17 | var indirect = 0; | ||
18 | |||
19 | document.querySelectorAll('.app-navigation-entry__counter').forEach( | ||
20 | function(counter) { | ||
21 | indirect += Number(counter.textContent) | ||
22 | } | ||
23 | ); | ||
24 | Ferdi.setBadge(direct, indirect); | ||
14 | }; | 25 | }; |
15 | 26 | ||
16 | Franz.loop(getMessages); | 27 | Ferdi.loop(getMessages); |
17 | Franz.injectCSS(_path.default.join(__dirname, 'service.css')); | 28 | Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); |
18 | }; | 29 | }; |