1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-13 11:44:55 +01:00

fix to only merge in history when possible

This commit is contained in:
Ian Storm Taylor 2017-10-31 22:43:48 -07:00
parent fe640f7afb
commit 485bfb6aa4

View File

@ -130,7 +130,7 @@ class History extends Record(DEFAULTS) {
debug('save', { operation, merge })
// If the `merge` flag is true, add the operation to the previous batch.
if (merge) {
if (merge && prevBatch) {
const batch = prevBatch.slice()
batch.push(operation)
undos = undos.pop()