From af2fd13ae1923d4d0d4bc357a75ccc969a7823a9 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Fri, 17 Nov 2023 23:14:16 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/9678 --- app/src/mobile/index.ts | 2 +- app/src/mobile/util/initFramework.ts | 6 +++++- app/src/protyle/header/Background.ts | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/src/mobile/index.ts b/app/src/mobile/index.ts index 6fb8c743d..d9eaa06d9 100644 --- a/app/src/mobile/index.ts +++ b/app/src/mobile/index.ts @@ -98,7 +98,7 @@ class App { fetchPost("/api/system/getEmojiConf", {}, emojiResponse => { window.siyuan.emojis = emojiResponse.data as IEmoji[]; setNoteBook(() => { - initFramework(this); + initFramework(this, confResponse.data.start); initRightMenu(this); openChangelog(); const unPinsMenu: IMenu[] = []; diff --git a/app/src/mobile/util/initFramework.ts b/app/src/mobile/util/initFramework.ts index 3a92cd921..7fc5ad539 100644 --- a/app/src/mobile/util/initFramework.ts +++ b/app/src/mobile/util/initFramework.ts @@ -20,7 +20,7 @@ import {syncGuide} from "../../sync/syncGuide"; import {Inbox} from "../../layout/dock/Inbox"; import {App} from "../../index"; -export const initFramework = (app: App) => { +export const initFramework = (app: App, isStart:boolean) => { setInlineStyle(); renderSnippet(); initKeyboardToolbar(); @@ -122,6 +122,10 @@ export const initFramework = (app: App) => { idZoomIn.isZoomIn ? [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]); return; } + if (window.siyuan.config.fileTree.closeTabsOnStart && isStart) { + setEmpty(app); + return; + } const localDoc = window.siyuan.storage[Constants.LOCAL_DOCINFO]; fetchPost("/api/block/checkBlockExist", {id: localDoc.id}, existResponse => { if (existResponse.data) { diff --git a/app/src/protyle/header/Background.ts b/app/src/protyle/header/Background.ts index 35e1c5172..50742831a 100644 --- a/app/src/protyle/header/Background.ts +++ b/app/src/protyle/header/Background.ts @@ -288,6 +288,9 @@ export class Background { id: protyle.block.rootID, attrs: {"title-img": this.ial["title-img"]} }); + /// #if MOBILE + window.siyuan.menus.menu.remove(); + /// #endif }, Constants.SIYUAN_ASSETS_IMAGE); event.preventDefault(); event.stopPropagation();