Skip to content

Commit

Permalink
index: Erase browser cache with settings
Browse files Browse the repository at this point in the history
Fix problems where the browser is still using old cached files

Signed-off-by: Patrick José Pereira <[email protected]>
  • Loading branch information
patrickelectric committed Jul 6, 2024
1 parent bb8de45 commit 0a56dcc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@

clearSettingsButton.addEventListener('click', function() {
localStorage.clear();
// We are also going to clear the cache to ensure a fresh access to all files as well
if (caches) {
const keys = await caches.keys();
await Promise.allSettled(keys.map((key) => caches.delete(key)));
}
location.reload();
});
})
Expand Down

0 comments on commit 0a56dcc

Please sign in to comment.