Skip to content

Commit b37583f

Browse files
author
Attila Cseh
committed
nonUndoableActions filtered
1 parent 6113e01 commit b37583f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

invokeai/frontend/web/src/features/controlLayers/store/canvasSlice.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2096,14 +2096,21 @@ const syncScaledSize = (canvas: CanvasState) => {
20962096

20972097
let filter = true;
20982098

2099+
const nonUndoableActions: string[] = [
2100+
canvasAdded.type,
2101+
canvasSelected.type,
2102+
canvasNameChanged.type,
2103+
canvasDeleted.type,
2104+
];
2105+
20992106
const canvasUndoableConfig: UndoableOptions<CanvasesState, UnknownAction> = {
21002107
limit: 64,
21012108
undoType: canvasUndo.type,
21022109
redoType: canvasRedo.type,
21032110
clearHistoryType: canvasClearHistory.type,
21042111
filter: (action, _state, _history) => {
2105-
// Ignore all actions from other slices
2106-
if (!action.type.startsWith(slice.name)) {
2112+
// Ignore both all actions from other slices and canvas management actions
2113+
if (!action.type.startsWith(slice.name) || (nonUndoableActions.includes(action.type))) {
21072114
return false;
21082115
}
21092116
// Throttle rapid actions of the same type

0 commit comments

Comments
 (0)