Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: fix https://github.com/siyuan-note/siyuan/issues/11610

Vanessa58efcd588d35
diff --git a/app/src/editor/util.ts b/app/src/editor/util.ts
index 2c0f8d16e3..93184460b1 100644
--- a/app/src/editor/util.ts
+++ b/app/src/editor/util.ts
@@ -187,18 +187,20 @@ export const openFile = async (options: IOpenFileOptions) => {
/// #if !BROWSER
// https://github.com/siyuan-note/siyuan/issues/7491
- let hasMatch = false;
- const optionsClone = Object.assign({}, options);
- delete optionsClone.app; // 防止 JSON.stringify 时产生递归
- hasMatch = await ipcRenderer.invoke(Constants.SIYUAN_GET, {
- cmd: Constants.SIYUAN_OPEN_FILE,
- options: JSON.stringify(optionsClone),
- });
- if (hasMatch) {
- if (options.afterOpen) {
- options.afterOpen();
+ if (!options.position) {
+ let hasMatch = false;
+ const optionsClone = Object.assign({}, options);
+ delete optionsClone.app; // 防止 JSON.stringify 时产生递归
+ hasMatch = await ipcRenderer.invoke(Constants.SIYUAN_GET, {
+ cmd: Constants.SIYUAN_OPEN_FILE,
+ options: JSON.stringify(optionsClone),
+ });
+ if (hasMatch) {
+ if (options.afterOpen) {
+ options.afterOpen();
+ }
+ return;
}
- return;
}
/// #endif