diff options
author | Carlos SolĂs <csolisr@gmail.com> | 2022-06-21 09:39:54 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-21 15:39:54 +0000 |
commit | 08a7af9ef2bb0030fd1876674d53b719e91f13e2 (patch) | |
tree | da71d5f5d17e90faaf0af07fd0e97936b8820aff /recipes/nextcloud-tasks/webview.js | |
parent | docs: add dqos as a contributor for code (#72) [skip ci] (diff) | |
download | ferdium-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-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 | }; |