🎨 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

@ -405,7 +405,7 @@ func createDailyNote(c *gin.Context) {
}
notebook := arg["notebook"].(string)
p, err := model.CreateDailyNote(notebook)
p, existed, err := model.CreateDailyNote(notebook)
if nil != err {
if model.ErrBoxNotFound == err {
ret.Code = 1
@ -425,7 +425,18 @@ func createDailyNote(c *gin.Context) {
return
}
evt := util.NewCmdResult("createdailynote", 0, util.PushModeBroadcast, util.PushModeNone)
appArg := arg["app"]
app := ""
if nil != appArg {
app = appArg.(string)
}
pushMode := util.PushModeBroadcast
if existed && "" != app {
pushMode = util.PushModeBroadcastApp
}
evt := util.NewCmdResult("createdailynote", 0, pushMode, util.PushModeNone)
evt.AppId = app
name := path.Base(p)
files, _, _ := model.ListDocTree(box.ID, path.Dir(p), model.Conf.FileTree.Sort)
evt.Data = map[string]interface{}{