Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: The interface is no longer reloaded after data synchronization https://github.com/siyuan-note/siyuan/issues/8098

Liang Ding5779bc14f6d5
diff --git a/kernel/model/repository.go b/kernel/model/repository.go
index 4d1e182b78..46284fe013 100644
--- a/kernel/model/repository.go
+++ b/kernel/model/repository.go
@@ -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
}