mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-05 05:17:51 +08:00
clearing all caches
This commit is contained in:
parent
f64660174d
commit
4486d2348c
2 changed files with 10 additions and 3 deletions
|
@ -3060,7 +3060,10 @@ export let defaultCommands = {
|
|||
display: "Clear SW cache",
|
||||
icon: "fa-cog",
|
||||
exec: async () => {
|
||||
await caches.delete("sw-cache");
|
||||
let caches = await caches.keys();
|
||||
for (let name of caches) {
|
||||
caches.delete(name);
|
||||
}
|
||||
window.location.reload(true);
|
||||
},
|
||||
},
|
||||
|
|
|
@ -19,10 +19,14 @@ export async function show(version) {
|
|||
window.location.hostname === "localhost" ||
|
||||
window.location.hostname === "127.0.0.1"
|
||||
) {
|
||||
caches.delete("sw-cache");
|
||||
caches.keys().then(function (names) {
|
||||
for (let name of names) caches.delete(name);
|
||||
});
|
||||
}
|
||||
if (memory === version) return;
|
||||
caches.delete("sw-cache");
|
||||
caches.keys().then(function (names) {
|
||||
for (let name of names) caches.delete(name);
|
||||
});
|
||||
Notifications.addBanner(
|
||||
`Version ${version} has been released. Click the version number in the bottom right to view the changelog.`,
|
||||
1,
|
||||
|
|
Loading…
Reference in a new issue