fix a config sync bug

This commit is contained in:
rustdesk 2023-06-04 16:48:24 +08:00
parent 89035b5223
commit 953d2e6e09

View File

@ -487,15 +487,17 @@ async fn sync_and_watch_config_dir() {
Data::SyncConfig(Some(configs)) => { Data::SyncConfig(Some(configs)) => {
let (config, config2) = *configs; let (config, config2) = *configs;
let _chk = crate::ipc::CheckIfRestart::new(); let _chk = crate::ipc::CheckIfRestart::new();
if cfg0.0 != config { if !config.is_empty() {
cfg0.0 = config.clone(); if cfg0.0 != config {
Config::set(config); cfg0.0 = config.clone();
log::info!("sync config from root"); Config::set(config);
} log::info!("sync config from root");
if cfg0.1 != config2 { }
cfg0.1 = config2.clone(); if cfg0.1 != config2 {
Config2::set(config2); cfg0.1 = config2.clone();
log::info!("sync config2 from root"); Config2::set(config2);
log::info!("sync config2 from root");
}
} }
synced = true; synced = true;
} }