diff options
Diffstat (limited to 'recipes/nextcloud-tasks/webview.js')
-rw-r--r-- | recipes/nextcloud-tasks/webview.js | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/recipes/nextcloud-tasks/webview.js b/recipes/nextcloud-tasks/webview.js index e9e6433..717fed7 100644 --- a/recipes/nextcloud-tasks/webview.js +++ b/recipes/nextcloud-tasks/webview.js | |||
@@ -1,15 +1,20 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | const _path = _interopRequireDefault(require('path')); |
2 | 2 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 3 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | ||
5 | } | ||
4 | 6 | ||
5 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
6 | const getMessages = () => { | 8 | const getMessages = () => { |
7 | const direct = document.querySelectorAll( | 9 | const directSelector = document.querySelectorAll( |
8 | '.app-navigation-entry-utils-counter.highlighted', | 10 | '.app-navigation-entry-utils-counter.highlighted', |
9 | ).length; | 11 | ); |
10 | const indirect = document.querySelectorAll( | 12 | const direct = directSelector ? Ferdium.safeParseInt(directSelector.length) : 0; |
13 | |||
14 | const indirectSelector = document.querySelectorAll( | ||
11 | '.app-navigation-entry-utils-counter:not(.highlighted)', | 15 | '.app-navigation-entry-utils-counter:not(.highlighted)', |
12 | ).length; | 16 | ); |
17 | const indirect = indirectSelector ? Ferdium.safeParseInt(indirectSelector.length) : 0; | ||
13 | 18 | ||
14 | Ferdium.setBadge(direct, indirect); | 19 | Ferdium.setBadge(direct, indirect); |
15 | }; | 20 | }; |