1
0
Fork 0
mirror of https://codeberg.org/ashley/poke.git synced 2024-11-17 02:34:38 -05:00

fix cache :3

This commit is contained in:
Ashley 2023-12-30 15:21:00 +00:00
parent a91feb61af
commit d55e146e73

View file

@ -1686,9 +1686,21 @@ checkbox.addEventListener('change', function(e) {
}
});
var cacheVersion = 1;
caches.delete('offline-cache' + cacheVersion)
if ('serviceWorker' in navigator) {
navigator.serviceWorker.getRegistrations().then(function(registrations) {
for (let registration of registrations) {
registration.unregister();
}
});
if ('caches' in window) {
caches.keys().then(function(cacheNames) {
cacheNames.forEach(function(cacheName) {
caches.delete(cacheName);
});
});
}
}
if (/[?&]autoplay=/.test(location.search)) {
checkbox.checked = true;