🎨 Documents created via the database are no longer automatically hidden Fix https://github.com/siyuan-note/siyuan/issues/9298

This commit is contained in:
Daniel 2023-09-27 16:11:18 +08:00
parent 4c47fdbdb1
commit 3842a17d07
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
4 changed files with 10 additions and 25 deletions

View file

@ -33,7 +33,7 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
func createDocsByHPath(boxID, hPath, content, parentID string, hidden bool) (id string, existed bool, err error) {
func createDocsByHPath(boxID, hPath, content, parentID string) (id string, existed bool, err error) {
hPath = strings.TrimSuffix(hPath, ".sy")
pathBuilder := bytes.Buffer{}
pathBuilder.WriteString("/")
@ -51,7 +51,7 @@ func createDocsByHPath(boxID, hPath, content, parentID string, hidden bool) (id
// 如果父文档存在且 ID 一致,则直接在父文档下创建
id = ast.NewNodeID()
p := strings.TrimSuffix(preferredParent.Path, ".sy") + "/" + id + ".sy"
if _, err = createDoc(boxID, p, name, content, hidden); nil != err {
if _, err = createDoc(boxID, p, name, content); nil != err {
return
}
}
@ -68,11 +68,11 @@ func createDocsByHPath(boxID, hPath, content, parentID string, hidden bool) (id
pathBuilder.WriteString(id)
docP := pathBuilder.String() + ".sy"
if isNotLast {
if _, err = createDoc(boxID, docP, part, "", hidden); nil != err {
if _, err = createDoc(boxID, docP, part, ""); nil != err {
return
}
} else {
if _, err = createDoc(boxID, docP, part, content, hidden); nil != err {
if _, err = createDoc(boxID, docP, part, content); nil != err {
return
}
}