Skip to content

Commit

Permalink
chore: bruno notifications endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
helloanoop committed Mar 12, 2024
1 parent 13eef74 commit 63684af
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions packages/bruno-electron/src/ipc/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,11 @@ const registerNotificationsIpc = (mainWindow, watcher) => {

module.exports = registerNotificationsIpc;

const fetchNotifications = async (props) => {
const fetchNotifications = async () => {
try {
const { lastNotificationId } = props || {};
let url = process.env.BRUNO_INFO_ENDPOINT;
if (!url) {
return Promise.reject('Invalid notifications endpoint', error);
}
if (lastNotificationId) url += `?lastNotificationId=${lastNotificationId}`;
let url = process.env.BRUNO_INFO_ENDPOINT || 'https://appinfo.usebruno.com';
const data = await fetch(url).then((res) => res.json());

return data?.notifications || [];
} catch (error) {
return Promise.reject('Error while fetching notifications!', error);
Expand Down

0 comments on commit 63684af

Please sign in to comment.