From c2f8adf93ea238374f01932b3c8b82b3d7ee3758 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Tue, 30 Apr 2024 12:32:39 +1000 Subject: [PATCH] fix(ui): deselect other layers when new layer added --- .../regionalPrompts/store/regionalPromptsSlice.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/invokeai/frontend/web/src/features/regionalPrompts/store/regionalPromptsSlice.ts b/invokeai/frontend/web/src/features/regionalPrompts/store/regionalPromptsSlice.ts index 88a025b559..1445f6cabd 100644 --- a/invokeai/frontend/web/src/features/regionalPrompts/store/regionalPromptsSlice.ts +++ b/invokeai/frontend/web/src/features/regionalPrompts/store/regionalPromptsSlice.ts @@ -109,6 +109,11 @@ export const regionalPromptsSlice = createSlice({ }; state.layers.push(layer); state.selectedLayerId = layer.id; + for (const layer of state.layers.filter(isRenderableLayer)) { + if (layer.id !== layerId) { + layer.isSelected = false; + } + } return; }, ipAdapterLayerAdded: (state, action: PayloadAction<{ layerId: string; ipAdapterId: string }>) => { @@ -139,6 +144,11 @@ export const regionalPromptsSlice = createSlice({ }; state.layers.push(layer); state.selectedLayerId = layer.id; + for (const layer of state.layers.filter(isRenderableLayer)) { + if (layer.id !== layerId) { + layer.isSelected = false; + } + } return; }, layerSelected: (state, action: PayloadAction) => {