From 42c355563cdac828c5788e8cd7f5969e221a6212 Mon Sep 17 00:00:00 2001 From: Jihoo Kim Date: Fri, 25 Aug 2023 04:43:27 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20sw,=20my-sw=20=EC=82=AC=EC=9A=A9?= =?UTF-8?q?=EC=8B=9C=20serviceWorker.js=EB=A1=9C=20=EB=8C=80=EC=B9=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/my-sw.js | 6 ++++++ public/sw.js | 6 ++++++ src/pages/home/HomePage.tsx | 6 +++--- src/serviceWorker.ts | 1 - 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/public/my-sw.js b/public/my-sw.js index f4415dfb..5212027d 100644 --- a/public/my-sw.js +++ b/public/my-sw.js @@ -16,3 +16,9 @@ if ('serviceWorker' in navigator) { }); }); } + +self.addEventListener('message', (event) => { + if (event.data && event.data.type === 'SKIP_WAITING') { + self.skipWaiting(); + } +}); diff --git a/public/sw.js b/public/sw.js index f4415dfb..5212027d 100644 --- a/public/sw.js +++ b/public/sw.js @@ -16,3 +16,9 @@ if ('serviceWorker' in navigator) { }); }); } + +self.addEventListener('message', (event) => { + if (event.data && event.data.type === 'SKIP_WAITING') { + self.skipWaiting(); + } +}); diff --git a/src/pages/home/HomePage.tsx b/src/pages/home/HomePage.tsx index bea615f5..3fa6ecb4 100644 --- a/src/pages/home/HomePage.tsx +++ b/src/pages/home/HomePage.tsx @@ -30,9 +30,9 @@ export default function HomePage() { return ( - {/**/} - {/* */} - {/**/} + + +
assignMultipleRefs(el, [ diff --git a/src/serviceWorker.ts b/src/serviceWorker.ts index f5eb2e67..8fa5debd 100644 --- a/src/serviceWorker.ts +++ b/src/serviceWorker.ts @@ -9,7 +9,6 @@ precacheAndRoute(self.__WB_MANIFEST); self.addEventListener('message', (event) => { if (event.data && event.data.type === 'SKIP_WAITING') { - console.log('here'); self.skipWaiting(); clientsClaim(); }