aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/nextcloud-carnet/webview.js
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/nextcloud-carnet/webview.js')
-rw-r--r--recipes/nextcloud-carnet/webview.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/recipes/nextcloud-carnet/webview.js b/recipes/nextcloud-carnet/webview.js
index e9e6433..b3836a7 100644
--- a/recipes/nextcloud-carnet/webview.js
+++ b/recipes/nextcloud-carnet/webview.js
@@ -4,12 +4,15 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
4 4
5module.exports = Ferdium => { 5module.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 };