From e782e034cce63737a671375df72143fac27d1b13 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Wed, 25 Jan 2023 21:41:35 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20getBlockInfo=20=E8=BF=94=E5=9B=9E=20cod?= =?UTF-8?q?e=20=3D=203=20=E6=97=B6=E5=91=8A=E7=9F=A5=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=AD=A3=E5=9C=A8=E7=B4=A2=E5=BC=95=EF=BC=8C=E8=AF=B7=E7=A8=8D?= =?UTF-8?q?=E5=90=8E=E5=86=8D=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/editor/util.ts | 5 +++++ app/src/mobile/editor.ts | 5 +++++ app/src/protyle/export/index.ts | 5 ++++- app/src/util/backForward.ts | 5 +++++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/app/src/editor/util.ts b/app/src/editor/util.ts index 98b9da7e5..a4df70866 100644 --- a/app/src/editor/util.ts +++ b/app/src/editor/util.ts @@ -23,6 +23,7 @@ import {getPreviousHeading} from "../protyle/wysiwyg/getBlock"; import {lockFile, setTitle} from "../dialog/processSystem"; import {zoomOut} from "../menus/protyle"; import {countBlockWord, countSelectWord} from "../layout/status"; +import {showMessage} from "../dialog/message"; export const openFileById = (options: { id: string, @@ -39,6 +40,10 @@ export const openFileById = (options: { lockFile(data.data); return; } + if (data.code === 3) { + showMessage(data.msg); + return; + } if (typeof options.removeCurrentTab === "undefined") { options.removeCurrentTab = true; } diff --git a/app/src/mobile/editor.ts b/app/src/mobile/editor.ts index a22eb1e1a..5561a4c0a 100644 --- a/app/src/mobile/editor.ts +++ b/app/src/mobile/editor.ts @@ -13,6 +13,7 @@ import {setEditMode} from "../protyle/util/setEditMode"; import {hideElements} from "../protyle/ui/hideElements"; import {pushBack} from "./util/MobileBackFoward"; import {setStorageVal} from "../protyle/util/compatibility"; +import {showMessage} from "../dialog/message"; export const openMobileFileById = (id: string, action = [Constants.CB_GET_HL]) => { window.siyuan.storage[Constants.LOCAL_DOCINFO] = {id, action}; @@ -44,6 +45,10 @@ export const openMobileFileById = (id: string, action = [Constants.CB_GET_HL]) = lockFile(data.data); return; } + if (data.code === 3) { + showMessage(data.msg); + return; + } if (window.siyuan.mobile.editor) { pushBack(); addLoading(window.siyuan.mobile.editor.protyle); diff --git a/app/src/protyle/export/index.ts b/app/src/protyle/export/index.ts index 745c0d5b4..edf26c87c 100644 --- a/app/src/protyle/export/index.ts +++ b/app/src/protyle/export/index.ts @@ -484,7 +484,10 @@ const getExportPath = (option: { type: string, id: string }, removeAssets?: bool lockFile(response.data); return; } - + if (response.code === 3) { + showMessage(response.msg); + return; + } let exportType = "HTML (SiYuan)"; switch (option.type) { case "htmlmd": diff --git a/app/src/util/backForward.ts b/app/src/util/backForward.ts index 6b882dfc6..b07ed4411 100644 --- a/app/src/util/backForward.ts +++ b/app/src/util/backForward.ts @@ -12,6 +12,7 @@ import {onGet} from "../protyle/util/onGet"; import {scrollCenter} from "./highlightById"; import {lockFile} from "../dialog/processSystem"; import {zoomOut} from "../menus/protyle"; +import {showMessage} from "../dialog/message"; let forwardStack: IBackStack[] = []; let previousIsBack = false; @@ -42,6 +43,10 @@ const focusStack = async (stack: IBackStack) => { lockFile(info.data); return false; } + if (info.code === 3) { + showMessage(info.msg); + return; + } const tab = new Tab({ title: info.data.rootTitle, docIcon: info.data.rootIcon,