worker: fix crash due to caches (fix #588)
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/602/head
parent
3113b0041e
commit
f1834e31ba
|
@ -22,11 +22,11 @@ const pendingUrls = new Map<string, BlobCallback[]>();
|
|||
// Cache for preview images
|
||||
const cacheName = "images";
|
||||
let imageCache: Cache;
|
||||
caches
|
||||
.open(cacheName)
|
||||
self.caches
|
||||
?.open(cacheName)
|
||||
.then((c) => (imageCache = c))
|
||||
.catch(() => {
|
||||
/* ignore */
|
||||
.catch((e) => {
|
||||
console.warn("Failed to open cache in worker", e);
|
||||
});
|
||||
|
||||
// Expiration for cache
|
||||
|
|
Loading…
Reference in New Issue