aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/nextcloud-cospend/webview.js
diff options
context:
space:
mode:
authorLibravatar Carlos SolĂ­s <csolisr@gmail.com>2022-06-21 09:39:54 -0600
committerLibravatar GitHub <noreply@github.com>2022-06-21 15:39:54 +0000
commit08a7af9ef2bb0030fd1876674d53b719e91f13e2 (patch)
treeda71d5f5d17e90faaf0af07fd0e97936b8820aff /recipes/nextcloud-cospend/webview.js
parentdocs: add dqos as a contributor for code (#72) [skip ci] (diff)
downloadferdium-recipes-08a7af9ef2bb0030fd1876674d53b719e91f13e2.tar.gz
ferdium-recipes-08a7af9ef2bb0030fd1876674d53b719e91f13e2.tar.zst
ferdium-recipes-08a7af9ef2bb0030fd1876674d53b719e91f13e2.zip
Add fixes for Nextcloud-related webapps (#66)
Diffstat (limited to 'recipes/nextcloud-cospend/webview.js')
-rw-r--r--recipes/nextcloud-cospend/webview.js11
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
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 };