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/8184

Vanessaf9e81c75f2e1
diff --git a/app/src/mobile/util/onMessage.ts b/app/src/mobile/util/onMessage.ts
index 73554fede9..54e62ff562 100644
--- a/app/src/mobile/util/onMessage.ts
+++ b/app/src/mobile/util/onMessage.ts
@@ -33,7 +33,6 @@ export const onMessage = (data: IWebSocketData) => {
document.getElementById("toolbarSync").classList.add("fn__none");
}
break;
- case "create":
case "createdailynote":
openMobileFileById(data.data.id);
break;
diff --git a/app/src/util/newFile.ts b/app/src/util/newFile.ts
index 77f7044ece..e92b4c46a5 100644
--- a/app/src/util/newFile.ts
+++ b/app/src/util/newFile.ts
@@ -83,6 +83,8 @@ export const newFile = (notebookId?: string, currentPath?: string, paths?: strin
}, response => {
/// #if !MOBILE
openFileById({id: response.data, action: [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]});
+ /// #else
+ openMobileFileById(response.data, [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]);
/// #endif
});
} else {
@@ -97,6 +99,8 @@ export const newFile = (notebookId?: string, currentPath?: string, paths?: strin
}, response => {
/// #if !MOBILE
openFileById({id: response.data, action: [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]});
+ /// #else
+ openMobileFileById(response.data, [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]);
/// #endif
});
});
@@ -121,6 +125,8 @@ export const newFile = (notebookId?: string, currentPath?: string, paths?: strin
}, () => {
/// #if !MOBILE
openFileById({id, action: [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]});
+ /// #else
+ openMobileFileById(id, [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]);
/// #endif
});
}
@@ -165,11 +171,11 @@ export const newFileByName = (value: string) => {
markdown: ""
}, response => {
hideElements(["dialog"]);
- if (isMobile()) {
- openMobileFileById(response.data, [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]);
- } else {
- openFileById({id: response.data, action: [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]});
- }
+ /// #if MOBILE
+ openMobileFileById(response.data, [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]);
+ /// #else
+ openFileById({id: response.data, action: [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]});
+ /// #endif
});
});
};