Преглед на файлове

feat: check for sw updates (#108)

Lucas Neves Pereira преди 1 месец
родител
ревизия
154f6181fd
променени са 1 файла, в които са добавени 2 реда и са изтрити 0 реда
  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);