|
|
@ -62,8 +62,12 @@ export const useUndoRedo = createSharedComposable(() => { |
|
|
|
|
|
|
|
|
|
|
|
const action = undoQueue.value.splice(actionIndex, 1)[0] |
|
|
|
const action = undoQueue.value.splice(actionIndex, 1)[0] |
|
|
|
if (action) { |
|
|
|
if (action) { |
|
|
|
await action.undo.fn.apply(action, action.undo.args) |
|
|
|
try { |
|
|
|
addRedo(action) |
|
|
|
await action.undo.fn.apply(action, action.undo.args) |
|
|
|
|
|
|
|
addRedo(action) |
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
|
|
|
|
message.warn('Error while undoing action, it is skipped.') |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -87,8 +91,12 @@ export const useUndoRedo = createSharedComposable(() => { |
|
|
|
|
|
|
|
|
|
|
|
const action = redoQueue.value.splice(actionIndex, 1)[0] |
|
|
|
const action = redoQueue.value.splice(actionIndex, 1)[0] |
|
|
|
if (action) { |
|
|
|
if (action) { |
|
|
|
await action.redo.fn.apply(action, action.redo.args) |
|
|
|
try { |
|
|
|
addUndo(action) |
|
|
|
await action.redo.fn.apply(action, action.redo.args) |
|
|
|
|
|
|
|
addUndo(action) |
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
|
|
|
|
message.warn('Error while redoing action, it is skipped.') |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|