🎨 Improve data sync perception when data merging https://github.com/siyuan-note/siyuan/issues/9740

This commit is contained in:
Daniel 2023-11-25 17:13:43 +08:00
parent 4cd93b0fec
commit 2f2abf0eff
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
5 changed files with 9 additions and 7 deletions

View file

@ -152,10 +152,10 @@ func BootSyncData() {
}
func SyncData(byHand bool) {
syncData(false, byHand, false)
syncData(false, byHand)
}
func syncData(exit, byHand, byWebSocket bool) {
func syncData(exit, byHand bool) {
defer logging.Recover()
if !checkSync(false, exit, byHand) {
@ -192,7 +192,7 @@ func syncData(exit, byHand, byWebSocket bool) {
connectSyncWebSocket()
}
if 1 == Conf.Sync.Mode && !byWebSocket && nil != webSocketConn && Conf.Sync.Perception && dataChanged {
if 1 == Conf.Sync.Mode && nil != webSocketConn && Conf.Sync.Perception && dataChanged {
// 如果处于自动同步模式且不是又 WS 触发的同步,则通知其他设备上的内核进行同步
request := map[string]interface{}{
"cmd": "synced",
@ -746,7 +746,7 @@ func connectSyncWebSocket() {
data := result.Data.(map[string]interface{})
switch data["cmd"].(string) {
case "synced":
syncData(false, false, true)
syncData(false, false)
case "kernels":
onlineKernelsLock.Lock()