MCPcopy Create free account
hub / github.com/apitable/apitable / undo

Method undo

packages/core/src/command_manager/undo_manager.ts:43–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41 }
42
43 undo(): ICollaCommandExecuteResult | null {
44 const { _undoStack: undoStack, _commandManager: commandManager } = this;
45 if (!undoStack.length) {
46 return null;
47 }
48 const undoAction = undoStack.pop();
49 if (undoAction && commandManager && commandManager.hasCommand(undoAction.cmd)) {
50 return commandManager._executeActions(undoAction.cmd, undoAction.result, ExecuteType.Undo);
51 }
52 return null;
53 }
54
55 redo(): ICollaCommandExecuteResult<{}> | null {
56 const { _redoStack: redoStack, _commandManager: commandManager } = this;

Callers 3

undoFunction · 0.80
undoFunction · 0.80

Calls 3

hasCommandMethod · 0.80
_executeActionsMethod · 0.80
popMethod · 0.45

Tested by

no test coverage detected