mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
fast claim all clients
This commit is contained in:
parent
a8db45a8ba
commit
c43cf33c95
@ -11,6 +11,16 @@ addEventListener('fetch', (event: any) => {
|
||||
event.respondWith(handleEvent(url, event.request))
|
||||
})
|
||||
|
||||
self.addEventListener('install', () => {
|
||||
// @ts-ignore
|
||||
self.skipWaiting()
|
||||
})
|
||||
|
||||
self.addEventListener('activate', (event) => {
|
||||
// @ts-ignore
|
||||
event.waitUntil(self.clients.claim())
|
||||
})
|
||||
|
||||
async function handleEvent (url, request) {
|
||||
try {
|
||||
const { html, status, headers } = await render(url.pathname, { req: request })
|
||||
|
Loading…
Reference in New Issue
Block a user