Przeglądaj źródła

fix routing fallback

AykutSarac 3 lat temu
rodzic
commit
9e7316ab31

+ 3 - 1
next.config.js

@@ -13,9 +13,11 @@ const nextConfig = {
     styledComponents: true,
   },
   pwa: {
-    disable: process.env.NODE_ENV === "development",
     dest: "public",
     register: true,
+    fallbacks: {
+      document: "/editor",
+    },
   },
 };
 

+ 1 - 1
public/fallback-development.js

@@ -7,7 +7,7 @@ self.fallback = async request => {
   // https://developer.mozilla.org/en-US/docs/Web/API/RequestDestination
   switch (request.destination) {
     case 'document':
-      if (true) return caches.match("/_offline", {
+      if (true) return caches.match("/editor", {
         ignoreSearch: true
       });
 

Plik diff jest za duży
+ 0 - 0
public/sw.js.map


+ 0 - 0
src/pages/_offline.tsx → src/pages/editor/index.tsx


Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików