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