diff --git a/lib/micropython-microbit-v2 b/lib/micropython-microbit-v2 index 8aaa36b8..17aaa115 160000 --- a/lib/micropython-microbit-v2 +++ b/lib/micropython-microbit-v2 @@ -1 +1 @@ -Subproject commit 8aaa36b8d50211f5902d50e050632a88358d369f +Subproject commit 17aaa115ad4ad285377b2eb210f37b0e94f61aa9 diff --git a/src/simulator.ts b/src/simulator.ts index 7b129130..74107222 100644 --- a/src/simulator.ts +++ b/src/simulator.ts @@ -47,13 +47,10 @@ if ("serviceWorker" in navigator) { if (flags.sw) { initServiceWorker(); } else { - navigator.serviceWorker.getRegistrations().then((registrations) => { - if (registrations.length > 0) { - // We should only have one service worker to unregister. - registrations[0].unregister().then(() => { - window.location.reload(); - }); - } + navigator.serviceWorker.getRegistration().then((registration) => { + registration?.unregister().then(() => { + window.location.reload(); + }); }); } }