periodicSync Notification text message update

This commit is contained in:
10G Meow 2024-05-26 16:56:36 +03:00
parent 7601ca68ce
commit 638e9bf505
4 changed files with 11 additions and 4 deletions

View file

@ -33,11 +33,12 @@ const registerPeriodicBackgroundSync = async (registration) => {
}
}
export function registerServiceWorker() {
export function registerServiceWorker(periodicSyncNewMsgReminderTxt) {
if("serviceWorker" in navigator) {
navigator.serviceWorker.register("./sw.js")
.then(async registration => {
console.log('Service Worker registered with scope:', registration.scope);
registration.active.postMessage(periodicSyncNewMsgReminderTxt);
await registerPeriodicBackgroundSync(registration);
})
.catch(error => {