An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: fix https://github.com/siyuan-note/siyuan/issues/7491
Vanessa5c2cc2778544
diff --git a/app/src/editor/util.ts b/app/src/editor/util.tsindex 41319684fd..0ba6023b52 100644--- a/app/src/editor/util.ts+++ b/app/src/editor/util.ts@@ -14,6 +14,7 @@ import {focusBlock, focusByRange} from "../protyle/util/selection";import {onGet} from "../protyle/util/onGet";/// #if !BROWSERimport {shell} from "electron";+import {BrowserWindow} from "@electron/remote";/// #endifimport {pushBack} from "../util/backForward";import {Asset} from "../asset";@@ -23,6 +24,7 @@ import {setTitle} from "../dialog/processSystem";import {zoomOut} from "../menus/protyle";import {countBlockWord, countSelectWord} from "../layout/status";import {showMessage} from "../dialog/message";+import {getSearch} from "../util/functions";export const openFileById = (options: {id: string,@@ -112,6 +114,26 @@ const openFile = (options: IOpenFileOptions) => {}}+ let hasOpen = false;+ /// #if !BROWSER+ // https://github.com/siyuan-note/siyuan/issues/7491+ BrowserWindow.getAllWindows().find((item) => {+ const json = getSearch("json", new URL(item.webContents.getURL()).search)+ if (json) {+ const jsonObj = JSON.parse(json);+ if ((jsonObj.children.rootId && jsonObj.children.rootId === options.rootID) ||+ (jsonObj.children.path && jsonObj.children.path === options.assetPath)) {+ item.focus();+ hasOpen = true;+ return true;+ }+ }+ });+ /// #endif+ if (hasOpen) {+ return;+ }+let wnd: Wnd = undefined;// 获取光标所在 tabconst element = document.querySelector(".layout__wnd--active");