feat(typedserver): Add SPA fallback support to TypedServer

This commit is contained in:
2025-12-04 17:26:34 +00:00
parent 9f6290f7aa
commit 95cd681380
5 changed files with 59 additions and 1 deletions

View File

@@ -110,6 +110,13 @@ export class ServiceWorker {
done.reject(error);
}
});
// Handle wake-up scenario: if already activated, connect immediately
// (install/activate events don't fire on wake-up)
if (selfArg.registration?.active) {
logger.log('info', 'SW woke up (already activated) - connecting to server');
this.connectToServer();
}
}
/**

View File

@@ -16,5 +16,6 @@ export interface ServiceWindow extends Window {
location: any;
skipWaiting: any;
clients: any;
registration?: ServiceWorkerRegistration;
}
declare var self: Window;