Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/pre-release-1.1.13' into fix/cro…
Browse files Browse the repository at this point in the history
…n-downtime
  • Loading branch information
0xNilesh committed Feb 8, 2024
2 parents 6320bfd + 19d3ae5 commit dae644c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion snap/dist/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion snap/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/ethereum-push-notification-service/push-protocol-snaps"
},
"source": {
"shasum": "3h8QmRFISxpD5m+g41R5ZvNlMFMSe14ITrjkVnLwI9M=",
"shasum": "E92WYxVcFeu9gtJzbctpTdjxmBwVajf+4747fGIma6o=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
17 changes: 13 additions & 4 deletions snap/src/utils/notifs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ export const getNotifications = async (address: string) => {
return feeds.feeds;
} else {
console.warn(`Invalid Ethereum address: ${address}`);
throw Error(`Error in getNotifications for ${address}: Invalid Ethereum address`);
throw Error(
`Error in getNotifications for ${address}: Invalid Ethereum address`
);
}
} catch (err) {
console.error(`Error in getNotifications for ${address}:`, err);
Expand Down Expand Up @@ -52,18 +54,26 @@ export const filterNotifications = async (
console.log("feedEpoch: ", feedEpoch);
console.log("i: ", i);
console.log("");
let emoji;
const aimg = fetchedNotifications[i].payload.data.aimg;

if (feedEpoch > processedLastEpoch) {
const msg =
if (aimg) {
emoji = `📸`;
} else {
emoji = `🔔`;
}

const msg = emoji +
fetchedNotifications[i].payload.data.app +
" : " +
convertText(fetchedNotifications[i].payload.data.amsg);
console.log(msg);

notiffeeds.push(msg);
}
}
}

notiffeeds = notiffeeds.reverse();
return notiffeeds;
} catch (error) {
Expand Down Expand Up @@ -128,4 +138,3 @@ const convertText = (text: string): string => {
throw error;
}
};

3 changes: 1 addition & 2 deletions snap/src/utils/toggle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ export const popupHelper = (notifs: string[]): string[] => {
// Format each notification for display
if (notifs.length > 0) {
notifs.forEach((notif) => {
const str = `\n🔔` + notif + "\n";
msg.push(str);
msg.push(notif);
});
}

Expand Down

0 comments on commit dae644c

Please sign in to comment.