From a9ad143521343fd656ae175b2ebbbd2bc9246563 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Fri, 7 Jul 2023 23:40:15 +0800 Subject: [PATCH] :art: Improve create workspace interaction https://github.com/siyuan-note/siyuan/issues/8700 --- kernel/api/workspace.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/kernel/api/workspace.go b/kernel/api/workspace.go index 09a4dfaa6..3a5df4f71 100644 --- a/kernel/api/workspace.go +++ b/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 {