mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-08 01:38:50 +01:00
🎨 The interface is no longer reloaded after data synchronization https://github.com/siyuan-note/siyuan/issues/8098
This commit is contained in:
parent
3d0b3c5ac9
commit
5779bc14f6
1 changed files with 13 additions and 1 deletions
|
|
@ -1193,7 +1193,7 @@ func processSyncMergeResult(exit, byHand bool, start time.Time, mergeResult *dej
|
|||
// 有数据变更,需要重建索引
|
||||
var upserts, removes []string
|
||||
var upsertTrees int
|
||||
var needReloadFlashcard, needReloadOcrTexts bool
|
||||
var needReloadFlashcard, needReloadOcrTexts, needReloadFiletree bool
|
||||
for _, file := range mergeResult.Upserts {
|
||||
upserts = append(upserts, file.Path)
|
||||
if strings.HasPrefix(file.Path, "/storage/riff/") {
|
||||
|
|
@ -1204,6 +1204,10 @@ func processSyncMergeResult(exit, byHand bool, start time.Time, mergeResult *dej
|
|||
needReloadOcrTexts = true
|
||||
}
|
||||
|
||||
if strings.HasSuffix(file.Path, "/.siyuan/conf.json") {
|
||||
needReloadFiletree = true
|
||||
}
|
||||
|
||||
if strings.HasSuffix(file.Path, ".sy") {
|
||||
upsertTrees++
|
||||
}
|
||||
|
|
@ -1217,6 +1221,10 @@ func processSyncMergeResult(exit, byHand bool, start time.Time, mergeResult *dej
|
|||
if strings.HasPrefix(file.Path, "/data/assets/ocr-texts.json") {
|
||||
needReloadOcrTexts = true
|
||||
}
|
||||
|
||||
if strings.HasSuffix(file.Path, "/.siyuan/conf.json") {
|
||||
needReloadFiletree = true
|
||||
}
|
||||
}
|
||||
|
||||
if needReloadFlashcard {
|
||||
|
|
@ -1236,6 +1244,10 @@ func processSyncMergeResult(exit, byHand bool, start time.Time, mergeResult *dej
|
|||
return
|
||||
}
|
||||
|
||||
if needReloadFiletree {
|
||||
util.BroadcastByType("filetree", "reloadFiletree", 0, "", nil)
|
||||
}
|
||||
|
||||
if exit { // 退出时同步不用推送事件
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue