diff options
author | 2021-12-03 13:16:42 +0100 | |
---|---|---|
committer | 2021-12-03 17:46:42 +0530 | |
commit | 2efcbcac8d055cbf4630813761ee0cdde84645ea (patch) | |
tree | 8cee4844a21433d367fbc1286b0640d1b3c628ed /recipes/circuit | |
parent | Add recipe for Nextcloud News (#780) (diff) | |
download | ferdium-recipes-2efcbcac8d055cbf4630813761ee0cdde84645ea.tar.gz ferdium-recipes-2efcbcac8d055cbf4630813761ee0cdde84645ea.tar.zst ferdium-recipes-2efcbcac8d055cbf4630813761ee0cdde84645ea.zip |
chore: upgrade dependencies to latest (#782)
* chore: upgrade dependencies to latest
- upgrade all dependencies to latest
- add --report-unused-disable-directives flag to lint script
- remove unused files reported by unicorn/no-empty-file
- minor cleanup of circuit recipe
- remove webview.js check in package.js
Diffstat (limited to 'recipes/circuit')
-rw-r--r-- | recipes/circuit/index.js | 1 | ||||
-rw-r--r-- | recipes/circuit/webview.js | 15 |
2 files changed, 10 insertions, 6 deletions
diff --git a/recipes/circuit/index.js b/recipes/circuit/index.js index fbbcd9a..23607bd 100644 --- a/recipes/circuit/index.js +++ b/recipes/circuit/index.js | |||
@@ -1,2 +1 @@ | |||
1 | // just pass through Ferdi | ||
2 | module.exports = Ferdi => Ferdi; | module.exports = Ferdi => Ferdi; | |
diff --git a/recipes/circuit/webview.js b/recipes/circuit/webview.js index 8cd2e2f..c04022d 100644 --- a/recipes/circuit/webview.js +++ b/recipes/circuit/webview.js | |||
@@ -1,11 +1,16 @@ | |||
1 | module.exports = Ferdi => { | 1 | module.exports = Ferdi => { |
2 | const getMessages = function getMessages() { | 2 | const getMessages = () => { |
3 | // Get value of <title> tag where in case of new messages the number of messages appear | 3 | // Get value of <title> tag where in case of new messages the number of messages appear |
4 | const titleValue = document.querySelector('title').text; | 4 | const title = document.querySelector('title'); |
5 | const match = titleValue.match(/\d+/); | 5 | if (title) { |
6 | const unread = match != null && match.length > 0 ? match[0] : 0; | 6 | const titleValue = title.text; |
7 | // Extract the number from the tag | ||
8 | const match = titleValue.match(/\d+/); | ||
9 | const unread = match != null && match.length > 0 ? match[0] : 0; | ||
7 | 10 | ||
8 | Ferdi.setBadge(Ferdi.safeParseInt(unread)); | 11 | // Set unread msgs badge |
12 | Ferdi.setBadge(Ferdi.safeParseInt(unread)); | ||
13 | } | ||
9 | }; | 14 | }; |
10 | 15 | ||
11 | Ferdi.loop(getMessages); | 16 | Ferdi.loop(getMessages); |