worker: fix crash due to caches (fix #588)

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/602/head
Varun Patil 2023-04-19 13:42:38 -07:00
parent 3113b0041e
commit f1834e31ba
1 changed files with 4 additions and 4 deletions

View File

@ -22,11 +22,11 @@ const pendingUrls = new Map<string, BlobCallback[]>();
// Cache for preview images // Cache for preview images
const cacheName = "images"; const cacheName = "images";
let imageCache: Cache; let imageCache: Cache;
caches self.caches
.open(cacheName) ?.open(cacheName)
.then((c) => (imageCache = c)) .then((c) => (imageCache = c))
.catch(() => { .catch((e) => {
/* ignore */ console.warn("Failed to open cache in worker", e);
}); });
// Expiration for cache // Expiration for cache