Skip to content

Commit b6c19a8

Browse files
psychedelicioushipsterusername
authored andcommitted
feat(ui): close viewer when adding a RG layer
1 parent 67d6cf1 commit b6c19a8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

invokeai/frontend/web/src/features/gallery/store/gallerySlice.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { PayloadAction } from '@reduxjs/toolkit';
22
import { createSlice, isAnyOf } from '@reduxjs/toolkit';
33
import type { PersistConfig, RootState } from 'app/store/store';
4+
import { rgLayerAdded } from 'features/controlLayers/store/controlLayersSlice';
45
import { setActiveTab } from 'features/ui/store/uiSlice';
56
import { uniqBy } from 'lodash-es';
67
import { boardsApi } from 'services/api/endpoints/boards';
@@ -89,6 +90,9 @@ export const gallerySlice = createSlice({
8990
builder.addCase(setActiveTab, (state) => {
9091
state.isImageViewerOpen = false;
9192
});
93+
builder.addCase(rgLayerAdded, (state) => {
94+
state.isImageViewerOpen = false;
95+
});
9296
builder.addMatcher(isAnyBoardDeleted, (state, action) => {
9397
const deletedBoardId = action.meta.arg.originalArgs;
9498
if (deletedBoardId === state.selectedBoardId) {

0 commit comments

Comments
 (0)