소스 검색

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);