From 03b00a6b8d51cad23103c03b2cc49b5fdb7d5519 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 26 Sep 2024 10:59:45 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/12098 --- app/src/dialog/processSystem.ts | 13 ++++++++----- app/src/index.ts | 2 +- app/src/mobile/util/onMessage.ts | 3 +++ app/src/window/index.ts | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/app/src/dialog/processSystem.ts b/app/src/dialog/processSystem.ts index b371a0cc3..f516cc881 100644 --- a/app/src/dialog/processSystem.ts +++ b/app/src/dialog/processSystem.ts @@ -43,7 +43,8 @@ export const reloadSync = ( hideMsg = true, // 同步的时候需要更新只读状态 https://github.com/siyuan-note/siyuan/issues/11517 // 调整大纲的时候需要使用现有状态 https://github.com/siyuan-note/siyuan/issues/11808 - updateReadonly = true + updateReadonly = true, + onlyUpdateDoc = false ) => { if (hideMsg) { hideMessage(); @@ -124,11 +125,13 @@ export const reloadSync = ( } } }); - allModels.files.forEach(item => { - setNoteBook(() => { - item.init(false); + if (onlyUpdateDoc) { + allModels.files.forEach(item => { + setNoteBook(() => { + item.init(false); + }); }); - }); + } allModels.bookmark.forEach(item => { item.update(); }); diff --git a/app/src/index.ts b/app/src/index.ts index fd519aeeb..6285b4434 100644 --- a/app/src/index.ts +++ b/app/src/index.ts @@ -77,7 +77,7 @@ export class App { reloadSync(this, data.data); break; case "reloaddoc": - reloadSync(this, {upsertRootIDs: [data.data], removeRootIDs: []}, false, false); + reloadSync(this, {upsertRootIDs: [data.data], removeRootIDs: []}, false, false, true); break; case "readonly": window.siyuan.config.editor.readOnly = data.data; diff --git a/app/src/mobile/util/onMessage.ts b/app/src/mobile/util/onMessage.ts index 318054f37..e03f47708 100644 --- a/app/src/mobile/util/onMessage.ts +++ b/app/src/mobile/util/onMessage.ts @@ -31,6 +31,9 @@ export const onMessage = (app: App, data: IWebSocketData) => { case "setConf": window.siyuan.config = data.data; break; + case "reloaddoc": + reloadSync(this, {upsertRootIDs: [data.data], removeRootIDs: []}, false, false, true); + break; case "readonly": window.siyuan.config.editor.readOnly = data.data; break; diff --git a/app/src/window/index.ts b/app/src/window/index.ts index a8a2a570a..3f28f41b3 100644 --- a/app/src/window/index.ts +++ b/app/src/window/index.ts @@ -63,7 +63,7 @@ class App { reloadEmoji(); break; case "reloaddoc": - reloadSync(this, {upsertRootIDs: [data.data], removeRootIDs: []}, false, false); + reloadSync(this, {upsertRootIDs: [data.data], removeRootIDs: []}, false, false, true); break; case "syncMergeResult": reloadSync(this, data.data);