Skip to content

Commit

Permalink
Support browsers that do not support caches
Browse files Browse the repository at this point in the history
Signed-off-by: Louis Chemineau <louis@chmn.me>
  • Loading branch information
artonge committed Jun 5, 2023
1 parent 9cf35ec commit 1d8058a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/services/PreviewService.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const SWCacheName = 'images'
* @param {string} previewUrl - The URL of the preview to check
*/
export const isCachedPreview = async function(previewUrl) {
const cache = await caches.open(SWCacheName)
const response = await cache.match(previewUrl)
const cache = await window.caches?.open(SWCacheName)
const response = await cache?.match(previewUrl)
return response !== undefined
}

0 comments on commit 1d8058a

Please sign in to comment.