diff --git a/app/src/layout/dock/Outline.ts b/app/src/layout/dock/Outline.ts index 8a5a6a051..8ab44cae6 100644 --- a/app/src/layout/dock/Outline.ts +++ b/app/src/layout/dock/Outline.ts @@ -357,11 +357,12 @@ export class Outline extends Model { } private onTransaction(data: IWebSocketData) { - if (this.isPreview) { + if (this.isPreview || data.data.rootID !== this.blockId) { return; } let needReload = false; - data.data[0].doOperations.forEach((item: IOperation) => { + const ops = data.data.sources[0]; + ops.doOperations.forEach((item: IOperation) => { if ((item.action === "update" || item.action === "insert") && (item.data.indexOf('data-type="NodeHeading"') > -1 || item.data.indexOf(`
`) > -1)) { needReload = true; @@ -369,8 +370,8 @@ export class Outline extends Model { needReload = true; } }); - if (data.data[0].undoOperations) { - data.data[0].undoOperations.forEach((item: IOperation) => { + if (ops.undoOperations) { + ops.undoOperations.forEach((item: IOperation) => { if (item.action === "update" && item.data.indexOf('data-type="NodeHeading"') > -1) { needReload = true; }