From 8e68e5f22b3f454a3423f5dbf0fb79c7e1647b86 Mon Sep 17 00:00:00 2001 From: x1unix Date: Mon, 28 Mar 2022 03:21:22 +0200 Subject: [PATCH] web: check service-worker for updates --- web/src/index.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/src/index.tsx b/web/src/index.tsx index 2a71542e..7b5225e2 100644 --- a/web/src/index.tsx +++ b/web/src/index.tsx @@ -16,4 +16,9 @@ ReactDOM.render(, document.getElementById('root')); // If you want your app to work offline and load faster, you can change // unregister() to register() below. Note this comes with some pitfalls. // Learn more about service workers: https://cra.link/PWA -serviceWorkerRegistration.register(); +serviceWorkerRegistration.register({ + onUpdate: (registration) => { + registration.update() + .catch(err => console.error('Failed to check updates: ', err)) + } +});