diff --git a/packages/nc-gui/composables/useUndoRedo.ts b/packages/nc-gui/composables/useUndoRedo.ts index 93ee1eb71a..b0b956928e 100644 --- a/packages/nc-gui/composables/useUndoRedo.ts +++ b/packages/nc-gui/composables/useUndoRedo.ts @@ -62,8 +62,12 @@ export const useUndoRedo = createSharedComposable(() => { const action = undoQueue.value.splice(actionIndex, 1)[0] if (action) { - await action.undo.fn.apply(action, action.undo.args) - addRedo(action) + try { + 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] if (action) { - await action.redo.fn.apply(action, action.redo.args) - addUndo(action) + try { + await action.redo.fn.apply(action, action.redo.args) + addUndo(action) + } catch (e) { + message.warn('Error while redoing action, it is skipped.') + } } }