diff --git a/invokeai/frontend/web/src/features/ui/store/uiSlice.ts b/invokeai/frontend/web/src/features/ui/store/uiSlice.ts index dbb37aa089..3a18c61307 100644 --- a/invokeai/frontend/web/src/features/ui/store/uiSlice.ts +++ b/invokeai/frontend/web/src/features/ui/store/uiSlice.ts @@ -1,6 +1,7 @@ import type { PayloadAction } from '@reduxjs/toolkit'; import { createSlice } from '@reduxjs/toolkit'; import type { PersistConfig, RootState } from 'app/store/store'; +import { galleryImageClicked } from 'features/gallery/store/gallerySlice'; import { initialImageChanged } from 'features/parameters/store/generationSlice'; import type { InvokeTabName } from './tabMap'; @@ -49,6 +50,14 @@ export const uiSlice = createSlice({ builder.addCase(initialImageChanged, (state) => { state.activeTab = 'img2img'; }); + + builder.addCase(galleryImageClicked, (state) => { + // When a gallery image is clicked and we are in progress mode, switch to image mode. + // This is not the same as the gallery _selection_ being changed. + if (state.viewerMode === 'progress') { + state.viewerMode = 'image'; + } + }); }, });