We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9d81538 commit 07b1ed7Copy full SHA for 07b1ed7
src/simulator.ts
@@ -47,13 +47,10 @@ if ("serviceWorker" in navigator) {
47
if (flags.sw) {
48
initServiceWorker();
49
} else {
50
- navigator.serviceWorker.getRegistrations().then((registrations) => {
51
- if (registrations.length > 0) {
52
- // We should only have one service worker to unregister.
53
- registrations[0].unregister().then(() => {
54
- window.location.reload();
55
- });
56
- }
+ navigator.serviceWorker.getRegistration().then((registration) => {
+ registration?.unregister().then(() => {
+ window.location.reload();
+ });
57
});
58
}
59
0 commit comments