From 301059acf735974f6da8be61879a4a9362987c08 Mon Sep 17 00:00:00 2001 From: stdavis Date: Mon, 2 Dec 2024 10:51:19 -0700 Subject: [PATCH] fix: reload window after service worker unregistration --- src/main.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.tsx b/src/main.tsx index b7f16ac..1392a53 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -16,7 +16,9 @@ if ("serviceWorker" in navigator) { function(registrations) { for (const registration of registrations) { console.log('Unregistering service worker:', registration); - registration.unregister(); + registration.unregister().then(function(success) { + if (success) window.location.reload(); + }); } } );