Quellcode durchsuchen

feat: check for sw updates (#108)

Lucas Neves Pereira vor 1 Monat
Ursprung
Commit
154f6181fd
1 geänderte Dateien mit 2 neuen und 0 gelöschten Zeilen
  1. 2 0
      src/components/pwa/ServiceWorkerRegistration.tsx

+ 2 - 0
src/components/pwa/ServiceWorkerRegistration.tsx

@@ -9,6 +9,8 @@ export function ServiceWorkerRegistration() {
         .register("/sw.js")
         .then((registration) => {
           console.log("SW registered: ", registration);
+          // Check for updates
+          registration.update();
         })
         .catch((registrationError) => {
           console.log("SW registration failed: ", registrationError);