From a839da34d778ac9a3535dec5ec4dfedaac9d80da Mon Sep 17 00:00:00 2001 From: Asher Date: Thu, 27 Aug 2020 11:33:34 -0500 Subject: [PATCH] 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. --- src/browser/serviceWorker.ts | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/browser/serviceWorker.ts b/src/browser/serviceWorker.ts index b7f2e9c5..1bee59bf 100644 --- a/src/browser/serviceWorker.ts +++ b/src/browser/serviceWorker.ts @@ -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. })