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:
Asher 2020-08-27 11:33:34 -05:00 committed by GitHub
parent eebb8bb314
commit a839da34d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 13 deletions

View File

@ -8,17 +8,6 @@ self.addEventListener("activate", (event: any) => {
event.waitUntil((self as any).clients.claim())
})
self.addEventListener("fetch", (event: any) => {
if (!navigator.onLine) {
event.respondWith(
new Promise((resolve) => {
resolve(
new Response("OFFLINE", {
status: 200,
statusText: "OK",
}),
)
}),
)
}
self.addEventListener("fetch", () => {
// Without this event handler we won't be recognized as a PWA.
})