debugging
All checks were successful
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 2m30s
All checks were successful
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 2m30s
This commit is contained in:
@@ -59,7 +59,12 @@ export async function subscribeToPushWithResult(): Promise<PushSubscribeResult>
|
||||
|
||||
let registration: ServiceWorkerRegistration
|
||||
try {
|
||||
// Timeout after 10 s — if SW never activates, don't hang forever
|
||||
// Explicitly register the SW so we don't race against index.html's 'load' handler.
|
||||
// navigator.serviceWorker.register() is idempotent — it returns the existing
|
||||
// registration if one already exists and does not re-install the worker.
|
||||
await navigator.serviceWorker.register('/sw.js')
|
||||
|
||||
// Now wait for it to become active. Use a generous timeout for slow mobile networks.
|
||||
registration = await Promise.race([
|
||||
navigator.serviceWorker.ready,
|
||||
new Promise<never>((_, reject) =>
|
||||
|
||||
Reference in New Issue
Block a user