mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 09:00:12 +01:00
🎨 Add parameter reloadUI for kernel API /api/block/transferBlockRef https://github.com/siyuan-note/siyuan/issues/10456
This commit is contained in:
parent
ba6dc2d992
commit
f1d2fb4147
2 changed files with 9 additions and 1 deletions
|
|
@ -62,6 +62,11 @@ func transferBlockRef(c *gin.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reloadUI := true
|
||||||
|
if nil != arg["reloadUI"] {
|
||||||
|
reloadUI = arg["reloadUI"].(bool)
|
||||||
|
}
|
||||||
|
|
||||||
var refIDs []string
|
var refIDs []string
|
||||||
if nil != arg["refIDs"] {
|
if nil != arg["refIDs"] {
|
||||||
for _, refID := range arg["refIDs"].([]interface{}) {
|
for _, refID := range arg["refIDs"].([]interface{}) {
|
||||||
|
|
@ -76,6 +81,10 @@ func transferBlockRef(c *gin.Context) {
|
||||||
ret.Data = map[string]interface{}{"closeTimeout": 7000}
|
ret.Data = map[string]interface{}{"closeTimeout": 7000}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if reloadUI {
|
||||||
|
util.ReloadUI()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func swapBlockRef(c *gin.Context) {
|
func swapBlockRef(c *gin.Context) {
|
||||||
|
|
|
||||||
|
|
@ -205,7 +205,6 @@ func TransferBlockRef(fromID, toID string, refIDs []string) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
sql.WaitForWritingDatabase()
|
sql.WaitForWritingDatabase()
|
||||||
util.ReloadUI()
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue