🎨 Alt+5 打开已有日记时不在内核伺服客户端之间同步 Fix https://github.com/siyuan-note/siyuan/issues/5617

This commit is contained in:
Liang Ding 2022-10-21 11:35:02 +08:00
parent 9fb4d9da2a
commit 8ac1104d6f
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
5 changed files with 41 additions and 11 deletions

View file

@ -33,9 +33,9 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
func createDocsByHPath(boxID, hPath, content string) (id string, err error) {
func createDocsByHPath(boxID, hPath, content string) (id string, existed bool, err error) {
hPath = strings.TrimSuffix(hPath, ".sy")
if docExist := nil != treenode.GetBlockTreeRootByHPath(boxID, hPath); docExist {
if existed = nil != treenode.GetBlockTreeRootByHPath(boxID, hPath); existed {
hPath += "-" + gulu.Rand.String(7)
}
pathBuilder := bytes.Buffer{}