Skip to content
This repository was archived by the owner on Feb 5, 2022. It is now read-only.

Commit d124fb3

Browse files
committed
fix: implement reload as in docs
1 parent f34a167 commit d124fb3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/pages/open-forge-app/open-forge-app.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ export class OpenForgeApp {
1515
@Listen('swUpdate', { target: 'window' })
1616
async onSWUpdate() {
1717
const registration = await navigator.serviceWorker.getRegistration();
18-
console.log(registration);
19-
if (registration && registration.waiting) {
20-
registration.waiting.postMessage('skipWaiting');
18+
19+
if (!registration || !registration.waiting) {
20+
return;
2121
}
22+
23+
registration.waiting.postMessage('skipWaiting');
2224
window.location.reload();
2325
}
2426

0 commit comments

Comments
 (0)