artcraft: land on previous batch's last image when arrow-key paging left

PageDraw lightbox left-arrow at a batch boundary called openBatchInLightbox
without a startIndex, defaulting to 0, so leftward traversal skipped every
non-first image in each prior batch.
This commit is contained in:
Tanish Manku authored and Brandon Thomas committed 2026-05-08 01:15:45 -04:00
1 parent c9a05259af
commit 70fee4f5ad
1 file changed
+7 -1
@@ -159,7 +159,13 @@ const TextToImage = ({ imageMediaId, imageUrl }: TextToImageProps) => {
galleryModalLightboxNavPrev.value =
batchIndex > 0
? () => openBatchInLightbox(inverseBatchRef.current[batchIndex - 1])
? () => {
const prevBatch = inverseBatchRef.current[batchIndex - 1];
openBatchInLightbox(
prevBatch,
Math.max(0, prevBatch.images.length - 1),
);
}
: null;
galleryModalLightboxNavNext.value =
batchIndex < inverseBatchRef.current.length - 1