From 6376d69b58ecd4e0bd4f2b9dd1105496559d12aa Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Sat, 23 Jun 2018 00:29:44 +0200 Subject: [PATCH 1/2] fix undo of map update --- src/Struct/Item.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Struct/Item.js b/src/Struct/Item.js index 3b03e33b..0a9da78f 100644 --- a/src/Struct/Item.js +++ b/src/Struct/Item.js @@ -87,7 +87,7 @@ export default class Item { * If the parent refers to this item with some kind of key (e.g. YMap, the * key is specified here. The key is then used to refer to the list in which * to insert this item. If `parentSub = null` type._start is the list in - * which to insert to. Otherwise it is `parent._start`. + * which to insert to. Otherwise it is `parent._map`. * @type {String} */ this._parentSub = null @@ -125,8 +125,17 @@ export default class Item { return this._redone } let struct = this._copy() - let left = this._left - let right = this + let left, right + if (this._parentSub === null) { + // Is an array item. Insert at the old position + left = this._left + right = this + } else { + // Is a map item. Insert at the start + left = null + right = this._parent._map.get(this._parentSub) + right._delete(y) + } let parent = this._parent // make sure that parent is redone if (parent._deleted === true && parent._redone === null) { From 860e4d7af6369e5e8f782372972362970fee82a4 Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Sat, 23 Jun 2018 00:30:45 +0200 Subject: [PATCH 2/2] 13.0.0-63 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 224c4480..276822b6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "yjs", - "version": "13.0.0-62", + "version": "13.0.0-63", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 9bcf54a7..ebc7221f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "yjs", - "version": "13.0.0-62", + "version": "13.0.0-63", "description": "A framework for real-time p2p shared editing on any data", "main": "./y.node.js", "browser": "./y.js",