diff --git a/src/models/history.js b/src/models/history.js index 1a1a45c03..3621faa68 100644 --- a/src/models/history.js +++ b/src/models/history.js @@ -80,7 +80,7 @@ class History extends new Record(DEFAULTS) { save(operation, options = {}) { let history = this - let { undos } = history + let { undos, redos } = history let { merge, skip } = options const prevBatch = undos.peek() const prevOperation = prevBatch && prevBatch[prevBatch.length - 1] @@ -118,7 +118,9 @@ class History extends new Record(DEFAULTS) { undos = undos.take(100) } - history = history.set('undos', undos) + // Clear the redos and update the history. + redos = redos.clear() + history = history.set('undos', undos).set('redos', redos) return history }