🎨 Add parameter reloadUI for kernel API /api/block/transferBlockRef https://github.com/siyuan-note/siyuan/issues/10456

This commit is contained in:
Daniel 2024-02-28 08:47:04 +08:00
parent ba6dc2d992
commit f1d2fb4147
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 9 additions and 1 deletions

View file

@ -62,6 +62,11 @@ func transferBlockRef(c *gin.Context) {
return
}
reloadUI := true
if nil != arg["reloadUI"] {
reloadUI = arg["reloadUI"].(bool)
}
var refIDs []string
if nil != arg["refIDs"] {
for _, refID := range arg["refIDs"].([]interface{}) {
@ -76,6 +81,10 @@ func transferBlockRef(c *gin.Context) {
ret.Data = map[string]interface{}{"closeTimeout": 7000}
return
}
if reloadUI {
util.ReloadUI()
}
}
func swapBlockRef(c *gin.Context) {

View file

@ -205,7 +205,6 @@ func TransferBlockRef(fromID, toID string, refIDs []string) (err error) {
}
sql.WaitForWritingDatabase()
util.ReloadUI()
return
}