mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-02 07:30:49 +08:00
🎨 Improve query embed block auto refresh https://github.com/siyuan-note/siyuan/issues/14370
This commit is contained in:
parent
5dab0ecdf6
commit
2a0034fa86
@ -236,12 +236,6 @@ func refreshDynamicRefTexts(updatedDefNodes map[string]*ast.Node, updatedTrees m
|
||||
switch defNode.refType {
|
||||
case "ref-d":
|
||||
task.AppendAsyncTaskWithDelay(task.SetRefDynamicText, 200*time.Millisecond, util.PushSetRefDynamicText, refTreeID, n.ID, defNode.id, defNode.refText)
|
||||
case "embed":
|
||||
go func() {
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
sql.FlushQueue()
|
||||
task.AppendAsyncTaskWithDelay(task.ReloadEmbedBlock, 200*time.Millisecond, util.PushReloadEmbedBlock, refTreeID, n.ID)
|
||||
}()
|
||||
}
|
||||
}
|
||||
return ast.WalkContinue
|
||||
|
@ -138,7 +138,6 @@ const (
|
||||
ReloadProtyle = "task.reload.protyle" // 重新加载编辑器
|
||||
SetRefDynamicText = "task.ref.setDynamicText" // 设置引用的动态锚文本
|
||||
SetDefRefCount = "task.def.setRefCount" // 设置定义的引用计数
|
||||
ReloadEmbedBlock = "task.ref.reloadEmbedBlock" // 重新加载嵌入块
|
||||
UpdateIDs = "task.update.ids" // 更新 ID
|
||||
PushMsg = "task.push.msg" // 推送消息
|
||||
)
|
||||
@ -159,7 +158,6 @@ var uniqueActions = []string{
|
||||
ReloadProtyle,
|
||||
SetRefDynamicText,
|
||||
SetDefRefCount,
|
||||
ReloadEmbedBlock,
|
||||
UpdateIDs,
|
||||
}
|
||||
|
||||
|
@ -275,10 +275,6 @@ func PushSetDefRefCount(rootID, blockID string, defIDs []string, refCount, rootR
|
||||
BroadcastByType("main", "setDefRefCount", 0, "", map[string]interface{}{"rootID": rootID, "blockID": blockID, "refCount": refCount, "rootRefCount": rootRefCount, "defIDs": defIDs})
|
||||
}
|
||||
|
||||
func PushReloadEmbedBlock(rootID, embedBlockID string) {
|
||||
BroadcastByType("main", "reloadEmbedBlock", 0, "", map[string]interface{}{"rootID": rootID, "embedBlockID": embedBlockID})
|
||||
}
|
||||
|
||||
func PushProtyleLoading(rootID, msg string) {
|
||||
BroadcastByType("protyle", "addLoading", 0, msg, rootID)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user