🎨 Improve query embed block auto refresh https://github.com/siyuan-note/siyuan/issues/14370

This commit is contained in:
Daniel 2025-03-16 21:02:30 +08:00
parent 5dab0ecdf6
commit 2a0034fa86
No known key found for this signature in database
GPG Key ID: 86211BA83DF03017
3 changed files with 0 additions and 12 deletions

View File

@ -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

View File

@ -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,
}

View File

@ -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)
}