mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 09:00:12 +01:00
This commit is contained in:
parent
e37bfe027a
commit
37b888f24d
1 changed files with 2 additions and 3 deletions
|
|
@ -111,10 +111,9 @@ export const newFile = (optios: {
|
||||||
/// #endif
|
/// #endif
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// TODO
|
|
||||||
fetchPost("/api/filetree/getHPathByPath", {
|
fetchPost("/api/filetree/getHPathByPath", {
|
||||||
notebook: data.data.box,
|
notebook: data.data.box,
|
||||||
path: optios.currentPath.endsWith(".sy") ? optios.currentPath : optios.currentPath + ".sy"
|
path: optios.notebookId === data.data.box ? (optios.currentPath.endsWith(".sy") ? optios.currentPath : optios.currentPath + ".sy") : (data.data.path || "/")
|
||||||
}, (responseHPath) => {
|
}, (responseHPath) => {
|
||||||
fetchPost("/api/filetree/createDocWithMd", {
|
fetchPost("/api/filetree/createDocWithMd", {
|
||||||
notebook: data.data.box,
|
notebook: data.data.box,
|
||||||
|
|
@ -140,7 +139,7 @@ export const newFile = (optios: {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const id = Lute.NewNodeID();
|
const id = Lute.NewNodeID();
|
||||||
const newPath = pathPosix().join(getDisplayName(optios.currentPath, false, true), id + ".sy");
|
const newPath = optios.notebookId === data.data.box ? (pathPosix().join(getDisplayName(optios.currentPath, false, true), id + ".sy")) : (data.data.path || "/");
|
||||||
if (optios.paths) {
|
if (optios.paths) {
|
||||||
optios.paths[optios.paths.indexOf(undefined)] = newPath;
|
optios.paths[optios.paths.indexOf(undefined)] = newPath;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue