mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Fixes next/prev image not working if category doesn't match
This commit is contained in:
parent
62c97dd7e6
commit
e096eef049
@ -157,7 +157,9 @@ export const gallerySlice = createSlice({
|
||||
selectNextImage: (state, action: PayloadAction<GalleryCategory>) => {
|
||||
const category = action.payload;
|
||||
const { currentImage } = state;
|
||||
const tempImages = state.categories[category].images;
|
||||
if (!currentImage) return;
|
||||
const tempImages =
|
||||
state.categories[currentImage.category as GalleryCategory].images;
|
||||
|
||||
if (currentImage) {
|
||||
const currentImageIndex = tempImages.findIndex(
|
||||
@ -173,7 +175,9 @@ export const gallerySlice = createSlice({
|
||||
selectPrevImage: (state, action: PayloadAction<GalleryCategory>) => {
|
||||
const category = action.payload;
|
||||
const { currentImage } = state;
|
||||
const tempImages = state.categories[category].images;
|
||||
if (!currentImage) return;
|
||||
const tempImages =
|
||||
state.categories[currentImage.category as GalleryCategory].images;
|
||||
|
||||
if (currentImage) {
|
||||
const currentImageIndex = tempImages.findIndex(
|
||||
|
Loading…
Reference in New Issue
Block a user