Skip to content

Commit f24f8c0

Browse files
committed
fix: Download only visible images in repo view
1 parent ada670a commit f24f8c0

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/components/ImageCell.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ const ImageCell = memo(function ImageCell({
9292
ref={handleImageRef}
9393
src={imageUrl}
9494
alt={`Image from ${path}`}
95-
decoding="async"
9695
className={cn(
9796
'size-full object-contain peer',
9897
loading ? 'hidden' : 'block',

src/pages/RepoView.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,11 @@ export default function RepoView() {
144144
),
145145
[repo, handleImageClick, mcmetaPaths, animationEnabled],
146146
)
147-
const [isDownloading, downloadAll] = usePromise(
148-
downloadImagesAsZip.bind(null, repo, imageOnlyFiles || []),
147+
const downloadVisibleImages = useCallback(
148+
() => downloadImagesAsZip(repo, filteredImageFiles || []),
149+
[repo, filteredImageFiles],
149150
)
151+
const [isDownloading, downloadAll] = usePromise(downloadVisibleImages)
150152

151153
return (
152154
<section

0 commit comments

Comments
 (0)