mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): layer is selected when added
This commit is contained in:
parent
21e814d766
commit
aeb0a45eb6
@ -44,13 +44,16 @@ export const controlAdaptersReducers = {
|
||||
processorPendingBatchId: null,
|
||||
...config,
|
||||
});
|
||||
state.selectedEntityIdentifier = { type: 'control_adapter', id };
|
||||
},
|
||||
prepare: (config: ControlNetConfig | T2IAdapterConfig) => ({
|
||||
payload: { id: uuidv4(), config },
|
||||
}),
|
||||
},
|
||||
caRecalled: (state, action: PayloadAction<{ data: ControlAdapterData }>) => {
|
||||
state.controlAdapters.push(action.payload.data);
|
||||
const { data } = action.payload;
|
||||
state.controlAdapters.push(data);
|
||||
state.selectedEntityIdentifier = { type: 'control_adapter', id: data.id };
|
||||
},
|
||||
caIsEnabledToggled: (state, action: PayloadAction<{ id: string }>) => {
|
||||
const { id } = action.payload;
|
||||
|
@ -25,11 +25,14 @@ export const ipAdaptersReducers = {
|
||||
...config,
|
||||
};
|
||||
state.ipAdapters.push(layer);
|
||||
state.selectedEntityIdentifier = { type: 'ip_adapter', id };
|
||||
},
|
||||
prepare: (config: IPAdapterConfig) => ({ payload: { id: uuidv4(), config } }),
|
||||
},
|
||||
ipaRecalled: (state, action: PayloadAction<{ data: IPAdapterData }>) => {
|
||||
state.ipAdapters.push(action.payload.data);
|
||||
const { data } = action.payload;
|
||||
state.ipAdapters.push(data);
|
||||
state.selectedEntityIdentifier = { type: 'ip_adapter', id: data.id };
|
||||
},
|
||||
ipaIsEnabledToggled: (state, action: PayloadAction<{ id: string }>) => {
|
||||
const { id } = action.payload;
|
||||
|
@ -38,11 +38,14 @@ export const layersReducers = {
|
||||
x: 0,
|
||||
y: 0,
|
||||
});
|
||||
state.selectedEntityIdentifier = { type: 'layer', id };
|
||||
},
|
||||
prepare: () => ({ payload: { id: uuidv4() } }),
|
||||
},
|
||||
layerRecalled: (state, action: PayloadAction<{ data: LayerData }>) => {
|
||||
state.layers.push(action.payload.data);
|
||||
const { data } = action.payload;
|
||||
state.layers.push(data);
|
||||
state.selectedEntityIdentifier = { type: 'layer', id: data.id };
|
||||
},
|
||||
layerIsEnabledToggled: (state, action: PayloadAction<{ id: string }>) => {
|
||||
const { id } = action.payload;
|
||||
|
@ -72,6 +72,7 @@ export const regionsReducers = {
|
||||
imageCache: null,
|
||||
};
|
||||
state.regions.push(rg);
|
||||
state.selectedEntityIdentifier = { type: 'regional_guidance', id };
|
||||
},
|
||||
prepare: () => ({ payload: { id: uuidv4() } }),
|
||||
},
|
||||
@ -89,6 +90,7 @@ export const regionsReducers = {
|
||||
rgRecalled: (state, action: PayloadAction<{ data: RegionalGuidanceData }>) => {
|
||||
const { data } = action.payload;
|
||||
state.regions.push(data);
|
||||
state.selectedEntityIdentifier = { type: 'regional_guidance', id: data.id };
|
||||
},
|
||||
rgIsEnabledToggled: (state, action: PayloadAction<{ id: string }>) => {
|
||||
const { id } = action.payload;
|
||||
|
Loading…
Reference in New Issue
Block a user