🎨 Improve dynamic anchor text auto-refresh stability https://github.com/siyuan-note/siyuan/issues/8234

This commit is contained in:
Daniel 2024-09-06 00:07:57 +08:00
parent ca17aee797
commit 1ff69fa257
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 4 additions and 1 deletions

View file

@ -40,6 +40,7 @@ import (
"github.com/siyuan-note/siyuan/kernel/cache" "github.com/siyuan-note/siyuan/kernel/cache"
"github.com/siyuan-note/siyuan/kernel/filesys" "github.com/siyuan-note/siyuan/kernel/filesys"
"github.com/siyuan-note/siyuan/kernel/sql" "github.com/siyuan-note/siyuan/kernel/sql"
"github.com/siyuan-note/siyuan/kernel/task"
"github.com/siyuan-note/siyuan/kernel/treenode" "github.com/siyuan-note/siyuan/kernel/treenode"
"github.com/siyuan-note/siyuan/kernel/util" "github.com/siyuan-note/siyuan/kernel/util"
) )
@ -1488,7 +1489,7 @@ func refreshDynamicRefTexts(updatedDefNodes map[string]*ast.Node, updatedTrees m
} }
// 推送动态锚文本节点刷新 // 推送动态锚文本节点刷新
util.PushReloadBlock(refTreeID, n.ID) task.AppendAsyncTaskWithDelay(task.ReloadProtyleBlock, 200*time.Millisecond, util.PushReloadBlock, refTreeID, n.ID)
return ast.WalkContinue return ast.WalkContinue
} }
return ast.WalkContinue return ast.WalkContinue

View file

@ -134,6 +134,7 @@ const (
AssetContentDatabaseIndexCommit = "task.asset.database.index.commit" // 资源文件数据库索引提交 AssetContentDatabaseIndexCommit = "task.asset.database.index.commit" // 资源文件数据库索引提交
CacheVirtualBlockRef = "task.cache.virtualBlockRef" // 缓存虚拟块引用 CacheVirtualBlockRef = "task.cache.virtualBlockRef" // 缓存虚拟块引用
ReloadAttributeView = "task.reload.attributeView" // 重新加载属性视图 ReloadAttributeView = "task.reload.attributeView" // 重新加载属性视图
ReloadProtyleBlock = "task.reload.protyleBlock" // 重载编辑器内容块
PushMsg = "task.push.msg" // 推送消息 PushMsg = "task.push.msg" // 推送消息
) )
@ -149,6 +150,7 @@ var uniqueActions = []string{
AssetContentDatabaseIndexFull, AssetContentDatabaseIndexFull,
AssetContentDatabaseIndexCommit, AssetContentDatabaseIndexCommit,
ReloadAttributeView, ReloadAttributeView,
ReloadProtyleBlock,
} }
func ContainIndexTask() bool { func ContainIndexTask() bool {