mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 10:00:13 +01:00
🚨
This commit is contained in:
parent
f15b2f8666
commit
b2b1089e3d
7 changed files with 27 additions and 22 deletions
|
|
@ -98,7 +98,7 @@ export const newFile = (optios: {
|
|||
}
|
||||
if ((data.data.path.indexOf("/") > -1 && optios.useSavePath) || optios.name) {
|
||||
if (data.data.path.startsWith("/") || optios.currentPath === "/") {
|
||||
const createPath = pathPosix().join(data.data.path, optios.name || (data.data.path.endsWith("/") ? window.siyuan.languages.untitled : ""))
|
||||
const createPath = pathPosix().join(data.data.path, optios.name || (data.data.path.endsWith("/") ? window.siyuan.languages.untitled : ""));
|
||||
fetchPost("/api/filetree/createDocWithMd", {
|
||||
notebook: data.data.box,
|
||||
path: createPath,
|
||||
|
|
@ -123,7 +123,7 @@ export const newFile = (optios: {
|
|||
notebook: data.data.box,
|
||||
path: optios.notebookId === data.data.box ? (optios.currentPath.endsWith(".sy") ? optios.currentPath : optios.currentPath + ".sy") : (data.data.path || "/")
|
||||
}, (responseHPath) => {
|
||||
const createPath = pathPosix().join(responseHPath.data, data.data.path, optios.name || (data.data.path.endsWith("/") ? window.siyuan.languages.untitled : ""))
|
||||
const createPath = pathPosix().join(responseHPath.data, data.data.path, optios.name || (data.data.path.endsWith("/") ? window.siyuan.languages.untitled : ""));
|
||||
fetchPost("/api/filetree/createDocWithMd", {
|
||||
notebook: data.data.box,
|
||||
path: createPath,
|
||||
|
|
@ -151,7 +151,7 @@ export const newFile = (optios: {
|
|||
return;
|
||||
}
|
||||
if (optios.notebookId !== data.data.box) {
|
||||
const createPath = pathPosix().join(data.data.path || "/", optios.name || (data.data.path.endsWith("/") ? window.siyuan.languages.untitled : ""))
|
||||
const createPath = pathPosix().join(data.data.path || "/", optios.name || (data.data.path.endsWith("/") ? window.siyuan.languages.untitled : ""));
|
||||
fetchPost("/api/filetree/createDocWithMd", {
|
||||
notebook: data.data.box,
|
||||
path: createPath,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue