From 04d59ef4a747fd4e03de73b34d4574d8bce7a8bb Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Thu, 5 Jan 2023 22:31:01 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=A1=8C=E9=9D=A2=E7=AB=AF=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=90=8C=E6=97=B6=E6=89=93=E5=BC=80=E5=A4=9A=E4=B8=AA?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E7=A9=BA=E9=97=B4=20https://github.com/siyua?= =?UTF-8?q?n-note/siyuan/issues/4567?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/dialog/processSystem.ts | 8 ++++---- app/src/util/pathName.ts | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/dialog/processSystem.ts b/app/src/dialog/processSystem.ts index 0d766d3a2..9feea2f80 100644 --- a/app/src/dialog/processSystem.ts +++ b/app/src/dialog/processSystem.ts @@ -10,7 +10,7 @@ import {Dialog} from "./index"; import {isMobile} from "../util/functions"; import {confirmDialog} from "./confirmDialog"; import {getCurrentWindow} from "@electron/remote"; -import {pathPosix} from "../util/pathName"; +import {originalPath} from "../util/pathName"; export const lockFile = (id: string) => { const html = `
@@ -263,15 +263,15 @@ export const bootSync = () => { export const setTitle = (title: string) => { const dragElement = document.getElementById("drag"); - const workspaceName = pathPosix().basename(window.siyuan.config.system.workspaceDir) + const workspaceName = originalPath().basename(window.siyuan.config.system.workspaceDir) if (title === window.siyuan.languages.siyuanNote) { - const versionTitle =`${workspaceName} - ${title} v${Constants.SIYUAN_VERSION}`; + const versionTitle = `${title} - ${workspaceName} - v${Constants.SIYUAN_VERSION}`; document.title = versionTitle; dragElement.textContent = versionTitle; dragElement.setAttribute("title", versionTitle); } else { title = title || "Untitled"; - document.title =`${workspaceName} - ${title} - ${window.siyuan.languages.siyuanNote} v${Constants.SIYUAN_VERSION}`; + document.title = `${title} - ${workspaceName} - ${window.siyuan.languages.siyuanNote} v${Constants.SIYUAN_VERSION}`; dragElement.textContent = title; dragElement.setAttribute("title", title); } diff --git a/app/src/util/pathName.ts b/app/src/util/pathName.ts index 3313ee9a4..4b71c734d 100644 --- a/app/src/util/pathName.ts +++ b/app/src/util/pathName.ts @@ -59,6 +59,10 @@ export const pathPosix = () => { return path; }; +export const originalPath = () => { + return path; +}; + export const getTopPaths = (liElements: Element[]) => { const fromPaths: string[] = []; liElements.forEach((item: HTMLElement) => {