summaryrefslogtreecommitdiffhomepage
path: root/src/lib/components/ImagePreview.svelte
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-04-09 19:40:01 +0900
committerAdam Malczewski <[email protected]>2026-04-09 19:40:01 +0900
commita39e2501b81c1e52437839e018bd5bf07b46616c (patch)
treec732f7e7b2c7bdf5fadf90a1b2d98bea3f8cbd13 /src/lib/components/ImagePreview.svelte
parent1bfd3e50842fdd511fc89d2b5892f8d440914cca (diff)
downloadflashair-speedsync-a39e2501b81c1e52437839e018bd5bf07b46616c.tar.gz
flashair-speedsync-a39e2501b81c1e52437839e018bd5bf07b46616c.zip
add image deletion
Diffstat (limited to 'src/lib/components/ImagePreview.svelte')
-rw-r--r--src/lib/components/ImagePreview.svelte10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/components/ImagePreview.svelte b/src/lib/components/ImagePreview.svelte
index 4a59d13..f5032a6 100644
--- a/src/lib/components/ImagePreview.svelte
+++ b/src/lib/components/ImagePreview.svelte
@@ -322,11 +322,7 @@
const abort = new AbortController();
currentAbort = abort;
- downloading = true;
- progress = 0;
- loadError = undefined;
-
- // Try cache first
+ // Try cache first — before setting downloading=true to avoid flicker
const cached = await imageCache.get('full', entry.path);
if (cached !== undefined && !abort.signal.aborted) {
const objectUrl = URL.createObjectURL(cached.blob);
@@ -337,6 +333,10 @@
return;
}
+ downloading = true;
+ progress = 0;
+ loadError = undefined;
+
const url = flashair.fileUrl(entry.path);
const totalBytes = entry.size;