diff options
author | Vijay A <vraravam@users.noreply.github.com> | 2021-12-03 04:35:58 +0530 |
---|---|---|
committer | Vijay A <vraravam@users.noreply.github.com> | 2021-12-03 04:35:58 +0530 |
commit | 10b057dd86897704c51a328239780bc5fed0f273 (patch) | |
tree | 396bdf865f48559c64be6d701dd8647c9e0430fa | |
parent | Stop clearing storage data on unload in WhatsApp recipe (#778) (diff) | |
download | ferdium-recipes-10b057dd86897704c51a328239780bc5fed0f273.tar.gz ferdium-recipes-10b057dd86897704c51a328239780bc5fed0f273.tar.zst ferdium-recipes-10b057dd86897704c51a328239780bc5fed0f273.zip |
fix: fix javascript error in 'circuit' recipe
-rw-r--r-- | all.json | 2 | ||||
-rw-r--r-- | recipes/circuit/index.js | 5 | ||||
-rw-r--r-- | recipes/circuit/package.json | 2 | ||||
-rw-r--r-- | recipes/circuit/webview.js | 17 |
4 files changed, 6 insertions, 20 deletions
@@ -207,7 +207,7 @@ | |||
207 | "featured": false, | 207 | "featured": false, |
208 | "id": "circuit", | 208 | "id": "circuit", |
209 | "name": "Circuit", | 209 | "name": "Circuit", |
210 | "version": "1.0.1", | 210 | "version": "1.0.2", |
211 | "icons": { | 211 | "icons": { |
212 | "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/recipes/circuit/icon.svg" | 212 | "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/recipes/circuit/icon.svg" |
213 | } | 213 | } |
diff --git a/recipes/circuit/index.js b/recipes/circuit/index.js index e467459..fbbcd9a 100644 --- a/recipes/circuit/index.js +++ b/recipes/circuit/index.js | |||
@@ -1,5 +1,2 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | // just pass through Ferdi | 1 | // just pass through Ferdi |
4 | 2 | module.exports = Ferdi => Ferdi; | |
5 | module.exports = Ferdi => Ferdi; \ No newline at end of file | ||
diff --git a/recipes/circuit/package.json b/recipes/circuit/package.json index 1beaa12..82eb193 100644 --- a/recipes/circuit/package.json +++ b/recipes/circuit/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "circuit", | 2 | "id": "circuit", |
3 | "name": "Circuit", | 3 | "name": "Circuit", |
4 | "version": "1.0.1", | 4 | "version": "1.0.2", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://eu.yourcircuit.com/" | 7 | "serviceURL": "https://eu.yourcircuit.com/" |
diff --git a/recipes/circuit/webview.js b/recipes/circuit/webview.js index b5e3fd5..8cd2e2f 100644 --- a/recipes/circuit/webview.js +++ b/recipes/circuit/webview.js | |||
@@ -1,23 +1,12 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | module.exports = Ferdi => { | 1 | module.exports = Ferdi => { |
4 | const getMessages = function getMessages() { | 2 | const getMessages = function getMessages() { |
5 | // Initialize empty vars | ||
6 | var match = []; | ||
7 | // 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 |
8 | const titleValue = document.querySelector('title').text; | 4 | const titleValue = document.querySelector('title').text; |
9 | // Extract the number from the tag | 5 | const match = titleValue.match(/\d+/); |
10 | match = titleValue.match(/\d+/); | 6 | const unread = match != null && match.length > 0 ? match[0] : 0; |
11 | unread = match != null && match.length > 0 ? match[0] : 0; | ||
12 | // Set unread msgs badge | ||
13 | 7 | ||
14 | Ferdi.setBadge(Ferdi.safeParseInt(unread)); | 8 | Ferdi.setBadge(Ferdi.safeParseInt(unread)); |
15 | }; | 9 | }; |
16 | 10 | ||
17 | const loopFunc = () => { | 11 | Ferdi.loop(getMessages); |
18 | getMessages(); | ||
19 | }; | ||
20 | |||
21 | Ferdi.loop(loopFunc); | ||
22 | |||
23 | }; | 12 | }; |