Skip to content

Commit

Permalink
Merge branch 'siyuan-note:dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
TCOTC authored Apr 8, 2024
2 parents c7c1dc0 + 859e19d commit ef626e4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 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
4 changes: 1 addition & 3 deletions kernel/model/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -1314,9 +1314,7 @@ func (tx *Transaction) commit() (err error) {
}

var sources []interface{}
for _, op := range tx.DoOperations {
sources = append(sources, op.Action)
}
sources = append(sources, tx)
util.PushSaveDoc(tree.ID, "tx", sources)
}
refreshDynamicRefTexts(tx.nodes, tx.trees)
Expand Down

0 comments on commit ef626e4

Please sign in to comment.