Skip to content

Commit aa79950

Browse files
author
Attila Cseh
committed
nonUndoableActions filtered
1 parent 4582c41 commit aa79950

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
@@ -2097,14 +2097,21 @@ const syncScaledSize = (canvas: CanvasState) => {
20972097

20982098
let filter = true;
20992099

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

0 commit comments

Comments
 (0)