Skip to content
This repository has been archived by the owner on Dec 15, 2024. It is now read-only.

Commit

Permalink
chore: customize notification
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemSBulgakov committed Nov 23, 2024
1 parent 70e8097 commit b49b3ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion frontend/public/sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@ self.addEventListener("push", (event) => {
const data = event.data;
const pushMessage = data.json();
console.log(event, pushMessage);
event.waitUntil(self.registration.showNotification(pushMessage.message));
event.waitUntil(
self.registration.showNotification("Единый Календарь Событий", {
body: pushMessage.message,
}),
);
});
2 changes: 1 addition & 1 deletion frontend/src/api/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export async function sendNotification(
return false;
}

await registration.showNotification("Спортивные мероприятия", {
await registration.showNotification("Единый Календарь Событий", {
body: message,
});
return true;
Expand Down

0 comments on commit b49b3ec

Please sign in to comment.