mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Fix index error on going past last image in Gallery
This commit is contained in:
parent
b50a1eb63f
commit
9950790f4c
@ -174,7 +174,7 @@ export const gallerySlice = createSlice({
|
||||
const currentImageIndex = tempImages.findIndex(
|
||||
(i) => i.uuid === currentImage.uuid
|
||||
);
|
||||
if (_.inRange(currentImageIndex, 0, tempImages.length)) {
|
||||
if (_.inRange(currentImageIndex, 0, tempImages.length - 1)) {
|
||||
const newCurrentImage = tempImages[currentImageIndex + 1];
|
||||
state.currentImage = newCurrentImage;
|
||||
state.currentImageUuid = newCurrentImage.uuid;
|
||||
|
Loading…
Reference in New Issue
Block a user