mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
🎨 Refresh doc tree after data sync https://github.com/siyuan-note/siyuan/issues/12860
This commit is contained in:
parent
f7f48b23f6
commit
667c9075b5
1 changed files with 8 additions and 6 deletions
|
|
@ -1521,10 +1521,6 @@ func processSyncMergeResult(exit, byHand bool, mergeResult *dejavu.MergeResult,
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if needReloadFiletree {
|
|
||||||
util.PushReloadFiletree()
|
|
||||||
}
|
|
||||||
|
|
||||||
if exit { // 退出时同步不用推送事件
|
if exit { // 退出时同步不用推送事件
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -1539,18 +1535,24 @@ func processSyncMergeResult(exit, byHand bool, mergeResult *dejavu.MergeResult,
|
||||||
box.Index()
|
box.Index()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if 0 < len(needUnindexBoxes) || 0 < len(needIndexBoxes) {
|
|
||||||
|
needReloadUI := 0 < len(needUnindexBoxes) || 0 < len(needIndexBoxes)
|
||||||
|
if needReloadUI {
|
||||||
util.ReloadUI()
|
util.ReloadUI()
|
||||||
}
|
}
|
||||||
|
|
||||||
upsertRootIDs, removeRootIDs := incReindex(upserts, removes)
|
upsertRootIDs, removeRootIDs := incReindex(upserts, removes)
|
||||||
|
needReloadFiletree = !needReloadUI && (needReloadFiletree || 0 < len(upsertRootIDs) || 0 < len(removeRootIDs))
|
||||||
|
if needReloadFiletree {
|
||||||
|
util.PushReloadFiletree()
|
||||||
|
}
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
util.WaitForUILoaded()
|
util.WaitForUILoaded()
|
||||||
|
|
||||||
if 0 < len(upsertRootIDs) || 0 < len(removeRootIDs) {
|
if 0 < len(upsertRootIDs) || 0 < len(removeRootIDs) {
|
||||||
util.BroadcastByType("main", "syncMergeResult", 0, "",
|
util.BroadcastByType("main", "syncMergeResult", 0, "",
|
||||||
map[string]interface{}{"upsertRootIDs": upsertRootIDs, "removeRootIDs": removeRootIDs})
|
map[string]interface{}{"upsertRootIDs": upsertRootIDs, "removeRootIDs": removeRootIDs})
|
||||||
util.PushReloadFiletree()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
time.Sleep(2 * time.Second)
|
time.Sleep(2 * time.Second)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue