Skip to content

Commit

Permalink
Fix Instagram messages count (#387)
Browse files Browse the repository at this point in the history
  • Loading branch information
victorbnl committed Jul 19, 2023
1 parent 587c10a commit 50c81e7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion recipes/instagram-direct-messages/package.json
Original file line number Diff line number Diff line change
@@ -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/",
Expand Down
2 changes: 1 addition & 1 deletion recipes/instagram-direct-messages/webview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion recipes/instagram/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion recipes/instagram/webview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 50c81e7

Please sign in to comment.