Skip to content

Commit

Permalink
🎨 fix #10884
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Apr 8, 2024
1 parent 951d53d commit 859e19d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/src/layout/dock/Outline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,20 +357,21 @@ 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(`<div contenteditable="true" spellcheck="${window.siyuan.config.editor.spellcheck}"><wbr></div>`) > -1)) {
needReload = true;
} else if (item.action === "delete" || item.action === "move") {
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;
}
Expand Down

0 comments on commit 859e19d

Please sign in to comment.