mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Fixes bug where discarding staged images results in loss of history
This commit is contained in:
parent
80f6f9a931
commit
d27d92325d
@ -328,9 +328,17 @@ export const canvasSlice = createSlice({
|
||||
state.futureLayerStates = [];
|
||||
},
|
||||
discardStagedImages: (state) => {
|
||||
state.pastLayerStates.push(_.cloneDeep(state.layerState));
|
||||
|
||||
if (state.pastLayerStates.length > state.maxHistory) {
|
||||
state.pastLayerStates.shift();
|
||||
}
|
||||
|
||||
state.layerState.stagingArea = {
|
||||
...initialLayerState.stagingArea,
|
||||
};
|
||||
|
||||
state.futureLayerStates = [];
|
||||
state.shouldShowStagingOutline = true;
|
||||
},
|
||||
addLine: (state, action: PayloadAction<number[]>) => {
|
||||
|
Loading…
Reference in New Issue
Block a user