mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
This commit is contained in:
parent
951d53d3f8
commit
859e19d755
1 changed files with 5 additions and 4 deletions
|
|
@ -357,11 +357,12 @@ export class Outline extends Model {
|
||||||
}
|
}
|
||||||
|
|
||||||
private onTransaction(data: IWebSocketData) {
|
private onTransaction(data: IWebSocketData) {
|
||||||
if (this.isPreview) {
|
if (this.isPreview || data.data.rootID !== this.blockId) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let needReload = false;
|
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") &&
|
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)) {
|
(item.data.indexOf('data-type="NodeHeading"') > -1 || item.data.indexOf(`<div contenteditable="true" spellcheck="${window.siyuan.config.editor.spellcheck}"><wbr></div>`) > -1)) {
|
||||||
needReload = true;
|
needReload = true;
|
||||||
|
|
@ -369,8 +370,8 @@ export class Outline extends Model {
|
||||||
needReload = true;
|
needReload = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (data.data[0].undoOperations) {
|
if (ops.undoOperations) {
|
||||||
data.data[0].undoOperations.forEach((item: IOperation) => {
|
ops.undoOperations.forEach((item: IOperation) => {
|
||||||
if (item.action === "update" && item.data.indexOf('data-type="NodeHeading"') > -1) {
|
if (item.action === "update" && item.data.indexOf('data-type="NodeHeading"') > -1) {
|
||||||
needReload = true;
|
needReload = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue