🎨 When New document save location is configured as /, it will be completed as /Untitled https://github.com/siyuan-note/siyuan/issues/10305

This commit is contained in:
Daniel
2024-02-04 10:15:28 +08:00
parent 2b37ea5d06
commit 3dc93ff409
4 changed files with 12 additions and 0 deletions

View File

@@ -612,6 +612,9 @@ func getDocCreateSavePath(c *gin.Context) {
if "../" == docCreateSavePathTpl {
docCreateSavePathTpl = "../Untitled"
}
if "/" == docCreateSavePathTpl {
docCreateSavePathTpl = "/Untitled"
}
p, err := model.RenderGoTemplate(docCreateSavePathTpl)
if nil != err {

View File

@@ -329,6 +329,9 @@ func setNotebookConf(c *gin.Context) {
if "../" == boxConf.DocCreateSavePath {
boxConf.DocCreateSavePath = "../Untitled"
}
if "/" == boxConf.DocCreateSavePath {
boxConf.DocCreateSavePath = "/Untitled"
}
box.SaveConf(boxConf)
ret.Data = boxConf

View File

@@ -398,6 +398,9 @@ func setFiletree(c *gin.Context) {
if "../" == fileTree.DocCreateSavePath {
fileTree.DocCreateSavePath = "../Untitled"
}
if "/" == fileTree.DocCreateSavePath {
fileTree.DocCreateSavePath = "/Untitled"
}
if 1 > fileTree.MaxOpenTabCount {
fileTree.MaxOpenTabCount = 8

View File

@@ -208,6 +208,9 @@ func InitConf() {
if "../" == Conf.FileTree.DocCreateSavePath {
Conf.FileTree.DocCreateSavePath = "../Untitled"
}
if "/" == Conf.FileTree.DocCreateSavePath {
Conf.FileTree.DocCreateSavePath = "/Untitled"
}
util.UseSingleLineSave = Conf.FileTree.UseSingleLineSave
util.CurrentCloudRegion = Conf.CloudRegion