chore: extract the adapter info initial state

This commit is contained in:
blessedcoolant 2023-09-16 16:08:04 +12:00 committed by Kent Keirsey
parent 820ec08e9a
commit 3e813ead1f

View File

@ -74,16 +74,18 @@ export type ControlNetState = {
ipAdapterInfo: IPAdapterConfig;
};
export const initialIPAdapterState: IPAdapterConfig = {
adapterImage: null,
model: null,
weight: 1,
};
export const initialControlNetState: ControlNetState = {
controlNets: {},
isEnabled: false,
pendingControlImages: [],
isIPAdapterEnabled: false,
ipAdapterInfo: {
adapterImage: null,
model: null,
weight: 1,
},
ipAdapterInfo: { ...initialIPAdapterState },
};
export const controlNetSlice = createSlice({
@ -388,11 +390,7 @@ export const controlNetSlice = createSlice({
},
ipAdapterStateReset: (state) => {
state.isIPAdapterEnabled = false;
state.ipAdapterInfo = {
adapterImage: null,
model: null,
weight: 1,
};
state.ipAdapterInfo = { ...initialIPAdapterState };
},
},
extraReducers: (builder) => {