From 2ea8e7240ed045b916955deaa568e9d2a61779ad Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 12 May 2021 08:30:18 +0200 Subject: [PATCH] Clear undo cache with noUndo --- src/undo_manager/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/undo_manager/index.js b/src/undo_manager/index.js index c5236cd5e..b8164db20 100644 --- a/src/undo_manager/index.js +++ b/src/undo_manager/index.js @@ -73,9 +73,10 @@ export default () => { on(object, v, opts) { !beforeCache && (beforeCache = object.previousAttributes()); const opt = opts || v || {}; - setTimeout(() => { - beforeCache = null; - }); + opt.noUndo && + setTimeout(() => { + beforeCache = null; + }); if (hasSkip(opt)) { return; } else {