mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-10 01:00:28 +03:00
Add claim and install events
This commit is contained in:
parent
5f52e932ae
commit
4cc1179a4f
1 changed files with 9 additions and 1 deletions
10
src/sw.ts
10
src/sw.ts
|
|
@ -28,7 +28,15 @@ function fetchConfig(token?: string): RequestInit | undefined {
|
|||
}
|
||||
|
||||
self.addEventListener('activate', (event: ExtendableEvent) => {
|
||||
event.waitUntil(clients.claim());
|
||||
event.waitUntil(
|
||||
(async () => {
|
||||
await self.clients.claim();
|
||||
})()
|
||||
);
|
||||
});
|
||||
|
||||
self.addEventListener('install', (event: ExtendableEvent) => {
|
||||
event.waitUntil(self.skipWaiting());
|
||||
});
|
||||
|
||||
self.addEventListener('fetch', (event: FetchEvent) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue