Skip to content

Commit

Permalink
fix: reload window after service worker unregistration
Browse files Browse the repository at this point in the history
  • Loading branch information
stdavis committed Dec 2, 2024
1 parent ddb1cab commit 301059a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
}
}
);
Expand Down

0 comments on commit 301059a

Please sign in to comment.