浏览代码

:art: Improve create workspace interaction https://github.com/siyuan-note/siyuan/issues/8700

Daniel 2 年之前
父节点
当前提交
a9ad143521
共有 1 个文件被更改,包括 10 次插入2 次删除
  1. 10 2
      kernel/api/workspace.go

+ 10 - 2
kernel/api/workspace.go

@@ -64,8 +64,16 @@ func checkWorkspaceDir(c *gin.Context) {
 
 	var existsConf, existsData bool
 	for _, entry := range entries {
-		existsConf = "conf" == entry.Name() && entry.IsDir()
-		existsData = "data" == entry.Name() && entry.IsDir()
+		if !existsConf {
+			existsConf = "conf" == entry.Name() && entry.IsDir()
+		}
+		if !existsData {
+			existsData = "data" == entry.Name() && entry.IsDir()
+		}
+
+		if existsConf && existsData {
+			break
+		}
 	}
 
 	if existsConf {