mirror of https://git.tuxpa.in/a/code-server.git
Remove custom offline text (#2007)
We need the handler to be recognized as a PWA but we can just let the original offline browser message show instead of our own message. See #1925 and #1979.
This commit is contained in:
parent
eebb8bb314
commit
a839da34d7
|
@ -8,17 +8,6 @@ self.addEventListener("activate", (event: any) => {
|
||||||
event.waitUntil((self as any).clients.claim())
|
event.waitUntil((self as any).clients.claim())
|
||||||
})
|
})
|
||||||
|
|
||||||
self.addEventListener("fetch", (event: any) => {
|
self.addEventListener("fetch", () => {
|
||||||
if (!navigator.onLine) {
|
// Without this event handler we won't be recognized as a PWA.
|
||||||
event.respondWith(
|
|
||||||
new Promise((resolve) => {
|
|
||||||
resolve(
|
|
||||||
new Response("OFFLINE", {
|
|
||||||
status: 200,
|
|
||||||
statusText: "OK",
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue