mirror of
https://github.com/immich-app/immich.git
synced 2025-12-21 17:25:35 +03:00
revert: service worker changes (#19227)
This commit is contained in:
@@ -3,21 +3,17 @@
|
||||
/// <reference lib="esnext" />
|
||||
/// <reference lib="webworker" />
|
||||
import { installBroadcastChannelListener } from './broadcast-channel';
|
||||
import { addFilesToCache, deleteOldCaches } from './cache';
|
||||
import { handleFetchEvent } from './fetch-event';
|
||||
import { deleteOldCaches, handleFetchEvent } from './fetch-event';
|
||||
|
||||
const sw = globalThis as unknown as ServiceWorkerGlobalScope;
|
||||
|
||||
const handleActivate = (event: ExtendableEvent) => {
|
||||
event.waitUntil(sw.clients.claim());
|
||||
// Remove previous cached data from disk
|
||||
event.waitUntil(deleteOldCaches());
|
||||
};
|
||||
|
||||
const handleInstall = (event: ExtendableEvent) => {
|
||||
event.waitUntil(sw.skipWaiting());
|
||||
// Create a new cache and add all files to it
|
||||
event.waitUntil(addFilesToCache());
|
||||
};
|
||||
|
||||
sw.addEventListener('install', handleInstall, { passive: true });
|
||||
|
||||
Reference in New Issue
Block a user