Skip to content

Commit

Permalink
Upgrade version and fix
Browse files Browse the repository at this point in the history
If not notification on instagram element html as null, set 0 if not notification
  • Loading branch information
Mralexandresys authored Nov 25, 2023
1 parent 90ff243 commit c3e6533
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 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.1.1",
"version": "1.1.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 @@ -14,7 +14,7 @@ module.exports = Ferdium => {
const getMessages = () => {
const element = document.querySelector('a[href^="/direct/inbox"] span');
Ferdium.setBadge(
element.textContent ? Ferdium.safeParseInt(element.textContent) : 0,
element && element.textContent ? Ferdium.safeParseInt(element.textContent) : 0,
);
};

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.5.2",
"version": "2.5.3",
"license": "MIT",
"config": {
"serviceURL": "https://instagram.com/",
Expand Down
9 changes: 4 additions & 5 deletions recipes/instagram/webview.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,10 @@ module.exports = (Ferdium, settings) => {

const getMessages = () => {
const element = document.querySelector('a[href^="/direct/inbox"] span');
if (element) {
Ferdium.setBadge(
element.textContent ? Ferdium.safeParseInt(element.textContent) : 0,
);
}
Ferdium.setBadge(
element && element.textContent ? Ferdium.safeParseInt(element.textContent) : 0,
);

};

Ferdium.loop(getMessages);
Expand Down

0 comments on commit c3e6533

Please sign in to comment.