From 50c81e77598b303356895c8d97748f21b9295ccf Mon Sep 17 00:00:00 2001 From: Victor B <39555268+victorbnl@users.noreply.github.com> Date: Thu, 20 Jul 2023 01:35:48 +0200 Subject: [PATCH] Fix Instagram messages count (#387) --- recipes/instagram-direct-messages/package.json | 2 +- recipes/instagram-direct-messages/webview.js | 2 +- recipes/instagram/package.json | 2 +- recipes/instagram/webview.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes/instagram-direct-messages/package.json b/recipes/instagram-direct-messages/package.json index 04de3fae8..927a92a05 100644 --- a/recipes/instagram-direct-messages/package.json +++ b/recipes/instagram-direct-messages/package.json @@ -1,7 +1,7 @@ { "id": "instagram-direct-messages", "name": "Instagram Direct Messages", - "version": "1.0.1", + "version": "1.0.2", "license": "MIT", "config": { "serviceURL": "https://www.instagram.com/direct/inbox/", diff --git a/recipes/instagram-direct-messages/webview.js b/recipes/instagram-direct-messages/webview.js index 290f59683..a59013ace 100644 --- a/recipes/instagram-direct-messages/webview.js +++ b/recipes/instagram-direct-messages/webview.js @@ -15,7 +15,7 @@ setInterval(() => { module.exports = (Ferdium) => { const getMessages = () => { const element = document.querySelector('a[href^="/direct/inbox"]'); - Ferdium.setBadge(element ? Ferdium.safeParseInt(element.textContent.match(/\d+/)[0]) : 0); + Ferdium.setBadge(element.textContent ? Ferdium.safeParseInt(element.textContent) : 0); }; Ferdium.loop(getMessages); diff --git a/recipes/instagram/package.json b/recipes/instagram/package.json index 4b8f7ac6d..beb7ce01f 100644 --- a/recipes/instagram/package.json +++ b/recipes/instagram/package.json @@ -1,7 +1,7 @@ { "id": "instagram", "name": "Instagram", - "version": "2.4.1", + "version": "2.4.2", "license": "MIT", "config": { "serviceURL": "https://instagram.com/direct/inbox", diff --git a/recipes/instagram/webview.js b/recipes/instagram/webview.js index e363ad332..c2a8433ab 100644 --- a/recipes/instagram/webview.js +++ b/recipes/instagram/webview.js @@ -7,7 +7,7 @@ function _interopRequireDefault(obj) { module.exports = Ferdium => { const getMessages = () => { const element = document.querySelector('a[href^="/direct/inbox"]'); - Ferdium.setBadge(element ? Ferdium.safeParseInt(element.textContent) : 0); + Ferdium.setBadge(element.textContent ? Ferdium.safeParseInt(element.textContent) : 0); }; Ferdium.loop(getMessages);