Skip to content

Commit

Permalink
Additional check on cache name before deletion.
Browse files Browse the repository at this point in the history
Co-authored-by: Matt Hillsdon <[email protected]>
  • Loading branch information
microbit-robert and microbit-matt-hillsdon authored May 28, 2024
1 parent 2063919 commit 6134ebd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ self.addEventListener("activate", (event) => {
const names = await caches.keys();
await Promise.all(
names.map((name) => {
if (name !== cacheName) {
if (/^simulator-/.test(name) && name !== cacheName) {
return caches.delete(name);
}
})
Expand Down

0 comments on commit 6134ebd

Please sign in to comment.