Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
try to update once before interval
Browse files Browse the repository at this point in the history
  • Loading branch information
atomicptr committed Dec 6, 2024
1 parent c223ba4 commit 6cfe036
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,18 @@ if ("serviceWorker" in navigator) {
if (!registration) {
return;
}
const interval = 1000; // 1s
setInterval(() => {

const updateFunc = () => {
registration.update();

// redirect to new site, after SW is updated
window.location.href = "https://dauntless-builder.com";
}, interval);
};

updateFunc();

const interval = 1000; // 1s
setInterval(updateFunc, interval);
},
});
}
Expand Down

0 comments on commit 6cfe036

Please sign in to comment.