Skip to content

Commit

Permalink
attempt to fix non existent update prompts
Browse files Browse the repository at this point in the history
  • Loading branch information
flyingeek committed Apr 19, 2024
1 parent fabb7e3 commit fc06926
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/stores.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@ export const checkSWUpdate = () => {
if ((new Date() - swLastUpdateDate) > timeout) {
navigator.serviceWorker.getRegistration().then(reg => {
if (reg) {
if (!reg.waiting) reg.update();
if (!reg.waiting) {
reg.update();
} else {
reg.waiting.postMessage('SKIP_WAITING');
}
swDismiss.set(false);
swLastUpdateDate = new Date();
}
Expand Down

0 comments on commit fc06926

Please sign in to comment.