diff options
author | 2023-07-20 01:35:48 +0200 | |
---|---|---|
committer | 2023-07-20 05:05:48 +0530 | |
commit | 50c81e77598b303356895c8d97748f21b9295ccf (patch) | |
tree | fb0bc3da77fee8e03a18f0bb280b749a9e3ba792 /recipes/instagram-direct-messages/webview.js | |
parent | Add Perplexity AI recipe (#388) (diff) | |
download | ferdium-recipes-50c81e77598b303356895c8d97748f21b9295ccf.tar.gz ferdium-recipes-50c81e77598b303356895c8d97748f21b9295ccf.tar.zst ferdium-recipes-50c81e77598b303356895c8d97748f21b9295ccf.zip |
Fix Instagram messages count (#387)
Diffstat (limited to 'recipes/instagram-direct-messages/webview.js')
-rw-r--r-- | recipes/instagram-direct-messages/webview.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/recipes/instagram-direct-messages/webview.js b/recipes/instagram-direct-messages/webview.js index 290f596..a59013a 100644 --- a/recipes/instagram-direct-messages/webview.js +++ b/recipes/instagram-direct-messages/webview.js | |||
@@ -15,7 +15,7 @@ setInterval(() => { | |||
15 | module.exports = (Ferdium) => { | 15 | module.exports = (Ferdium) => { |
16 | const getMessages = () => { | 16 | const getMessages = () => { |
17 | const element = document.querySelector('a[href^="/direct/inbox"]'); | 17 | const element = document.querySelector('a[href^="/direct/inbox"]'); |
18 | Ferdium.setBadge(element ? Ferdium.safeParseInt(element.textContent.match(/\d+/)[0]) : 0); | 18 | Ferdium.setBadge(element.textContent ? Ferdium.safeParseInt(element.textContent) : 0); |
19 | }; | 19 | }; |
20 | 20 | ||
21 | Ferdium.loop(getMessages); | 21 | Ferdium.loop(getMessages); |