mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
🎨 Improve refreshing of doc tree when creating doc https://github.com/siyuan-note/siyuan/issues/12109
This commit is contained in:
parent
4824feaa2f
commit
947dbc4787
1 changed files with 21 additions and 6 deletions
|
|
@ -695,8 +695,16 @@ func createDoc(c *gin.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
model.FlushTxQueue()
|
model.FlushTxQueue()
|
||||||
box := model.Conf.Box(notebook)
|
|
||||||
pushCreate(box, p, arg)
|
pushCreateEvt := true
|
||||||
|
pushCreateEvtArg := arg["pushCreateEvt"]
|
||||||
|
if nil != pushCreateEvtArg {
|
||||||
|
pushCreateEvt = pushCreateEvtArg.(bool)
|
||||||
|
}
|
||||||
|
if pushCreateEvt {
|
||||||
|
box := model.Conf.Box(notebook)
|
||||||
|
pushCreate(box, p, arg)
|
||||||
|
}
|
||||||
|
|
||||||
ret.Data = map[string]interface{}{
|
ret.Data = map[string]interface{}{
|
||||||
"id": tree.Root.ID,
|
"id": tree.Root.ID,
|
||||||
|
|
@ -829,10 +837,17 @@ func createDocWithMd(c *gin.Context) {
|
||||||
ret.Data = id
|
ret.Data = id
|
||||||
|
|
||||||
model.FlushTxQueue()
|
model.FlushTxQueue()
|
||||||
box := model.Conf.Box(notebook)
|
|
||||||
b, _ := model.GetBlock(id, nil)
|
pushCreateEvt := true
|
||||||
p := b.Path
|
pushCreateEvtArg := arg["pushCreateEvt"]
|
||||||
pushCreate(box, p, arg)
|
if nil != pushCreateEvtArg {
|
||||||
|
pushCreateEvt = pushCreateEvtArg.(bool)
|
||||||
|
}
|
||||||
|
if pushCreateEvt {
|
||||||
|
box := model.Conf.Box(notebook)
|
||||||
|
b, _ := model.GetBlock(id, nil)
|
||||||
|
pushCreate(box, b.Path, arg)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func getDocCreateSavePath(c *gin.Context) {
|
func getDocCreateSavePath(c *gin.Context) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue