From c7809a7403a02bab2a87f7df0ce3b7c538a936f1 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Tue, 17 Jan 2023 01:28:58 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/pull/7086 --- app/src/layout/util.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/src/layout/util.ts b/app/src/layout/util.ts index 1ee0cc717..df78d03b0 100644 --- a/app/src/layout/util.ts +++ b/app/src/layout/util.ts @@ -301,11 +301,14 @@ export const JSONToLayout = (isStart: boolean) => { // https://github.com/siyuan-note/siyuan/pull/7086 const openId = getSearch("id"); if (openId) { - openFileById({ - id: openId, - action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT], - zoomIn: getSearch("focus") === "1" - }); + // 启动时 layout 中有该文档,该文档还原会在此之后,因此需有延迟 + setTimeout(() => { + openFileById({ + id: openId, + action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT], + zoomIn: getSearch("focus") === "1" + }); + }, Constants.TIMEOUT_BLOCKLOAD); } };