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

Vanessa18b9faa6dcdb
diff --git a/app/src/util/newFile.ts b/app/src/util/newFile.ts
index ca08a68d02..58746ff09b 100644
--- a/app/src/util/newFile.ts
+++ b/app/src/util/newFile.ts
@@ -79,22 +79,18 @@ export const newFile = (notebookId?: string, currentPath?: string, open?: boolea
};
export const getSavePath = (pathString: string, notebookId: string, cb: (p: string) => void) => {
- fetchPost("/api/notebook/getNotebookConf", {
+ fetchPost("/api/filetree/getRefCreateSavePath", {
notebook: notebookId
}, (data) => {
- let savePath = data.data.conf.refCreateSavePath;
- if (!savePath) {
- savePath = window.siyuan.config.fileTree.refCreateSavePath;
- }
- if (savePath) {
- if (savePath.startsWith("/")) {
- cb(getDisplayName(savePath, false, true));
+ if (data.data.path) {
+ if (data.data.path.startsWith("/")) {
+ cb(getDisplayName(data.data.path, false, true));
} else {
fetchPost("/api/filetree/getHPathByPath", {
notebook: notebookId,
path: pathString
}, (response) => {
- cb(getDisplayName(pathPosix().join(response.data, savePath), false, true));
+ cb(getDisplayName(pathPosix().join(response.data, data.data.path), false, true));
});
}
} else {