fix undoing of content containing subdocs

This commit is contained in:
Kevin Jahns
2021-11-19 13:47:10 +01:00
parent 4154b12f14
commit 9a7250f192
3 changed files with 25 additions and 13 deletions

View File

@@ -249,13 +249,8 @@ export class Doc extends Observable {
if (item !== null) {
this._item = null
const content = /** @type {ContentDoc} */ (item.content)
if (item.deleted) {
// @ts-ignore
content.doc = null
} else {
content.doc = new Doc({ guid: this.guid, ...content.opts, shouldLoad: false })
content.doc._item = item
}
content.doc = new Doc({ guid: this.guid, ...content.opts, shouldLoad: false })
content.doc._item = item
transact(/** @type {any} */ (item).parent.doc, transaction => {
const doc = content.doc
if (!item.deleted) {