Skip to content

Commit

Permalink
stash
Browse files Browse the repository at this point in the history
  • Loading branch information
incognitojam committed Feb 28, 2025
1 parent 096d964 commit e509d70
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/workers/image.worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const imageWorker = {
async init() {
if (!root) {
root = await navigator.storage.getDirectory()
await root.remove({ recursive: true })
// await root.remove({ recursive: true })
console.info('[ImageWorker] Initialized')
}

Expand All @@ -74,6 +74,14 @@ const imageWorker = {
async downloadImage(image, onProgress = undefined) {
const { archiveUrl, checksum: expectedChecksum, fileName, size } = image

// Skip if already downloaded
try {
await root.getFileHandle(fileName)
return
} catch {
// ignored
}

let writable
try {
const fileHandle = await root.getFileHandle(fileName, { create: true })
Expand Down

0 comments on commit e509d70

Please sign in to comment.