Skip to content

Commit 5e8d5ae

Browse files
committed
always reload not just when sw is ready
1 parent 41cf380 commit 5e8d5ae

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

.changeset/ensure-sw-refresh.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
default: patch
3+
---
4+
5+
Ensure new updates always reload the page properly.

src/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,8 @@ if ('serviceWorker' in navigator) {
5454
if (window.confirm('A new version of the app is available. Refresh to update?')) {
5555
if (registration.waiting) {
5656
registration.waiting.postMessage({ type: 'SKIP_WAITING_AND_CLAIM' });
57-
} else {
58-
window.location.reload();
5957
}
58+
window.location.reload();
6059
}
6160
};
6261

0 commit comments

Comments
 (0)