From 953d2e6e09912a384a0b085f90aa7ad66786ae88 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Sun, 4 Jun 2023 16:48:24 +0800 Subject: [PATCH] fix a config sync bug --- src/server.rs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/server.rs b/src/server.rs index 2b833576a..de8fd2e7f 100644 --- a/src/server.rs +++ b/src/server.rs @@ -487,15 +487,17 @@ async fn sync_and_watch_config_dir() { Data::SyncConfig(Some(configs)) => { let (config, config2) = *configs; let _chk = crate::ipc::CheckIfRestart::new(); - if cfg0.0 != config { - cfg0.0 = config.clone(); - Config::set(config); - log::info!("sync config from root"); - } - if cfg0.1 != config2 { - cfg0.1 = config2.clone(); - Config2::set(config2); - log::info!("sync config2 from root"); + if !config.is_empty() { + if cfg0.0 != config { + cfg0.0 = config.clone(); + Config::set(config); + log::info!("sync config from root"); + } + if cfg0.1 != config2 { + cfg0.1 = config2.clone(); + Config2::set(config2); + log::info!("sync config2 from root"); + } } synced = true; }