From 2f9d2afcd3971026aea4bb8f106552004654d7b6 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sat, 20 Sep 2025 17:02:11 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/15885 --- app/src/layout/util.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/layout/util.ts b/app/src/layout/util.ts index 0229521a8..85f1d0c5b 100644 --- a/app/src/layout/util.ts +++ b/app/src/layout/util.ts @@ -744,13 +744,20 @@ export const newModelByInitData = (app: App, tab: Tab, json: any) => { }); } } else if (json.instance === "Editor") { + if (json.rootId === json.blockId && json.action) { + if (typeof json.action === "string") { + json.action = json.action.replace(Constants.CB_GET_ALL, ""); + } else if (typeof json.action === "object" && Array.isArray(json.action)) { + json.action = json.action.filter((item: string) => item !== Constants.CB_GET_ALL); + } + } model = new Editor({ app, tab, rootId: json.rootId, blockId: json.blockId, mode: json.mode, - action: typeof json.action === "string" ? [json.action, Constants.CB_GET_FOCUS] : json.action.concat(Constants.CB_GET_FOCUS), + action: typeof json.action === "string" ? (json.action ? [json.action, Constants.CB_GET_FOCUS] : [Constants.CB_GET_FOCUS]) : json.action.concat(Constants.CB_GET_FOCUS), }); } return model;