From 5d0384f580d8581ef25273accecc200f37383b5b Mon Sep 17 00:00:00 2001 From: 21pages Date: Fri, 13 Oct 2023 09:37:13 +0800 Subject: [PATCH] sync option share rdp Signed-off-by: 21pages --- src/hbbs_http/sync.rs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/hbbs_http/sync.rs b/src/hbbs_http/sync.rs index e997a2794..e020c5a68 100644 --- a/src/hbbs_http/sync.rs +++ b/src/hbbs_http/sync.rs @@ -147,10 +147,22 @@ fn handle_config_options(config_options: HashMap) { config_options .iter() .map(|(k, v)| { - if v.is_empty() { - options.remove(k); + if k == "allow-share-rdp" { + // only changes made after installation take effect. + #[cfg(windows)] + if crate::ui_interface::is_rdp_service_open() { + let current = crate::ui_interface::is_share_rdp(); + let set = v == "Y"; + if current != set { + crate::platform::windows::set_share_rdp(set); + } + } } else { - options.insert(k.to_string(), v.to_string()); + if v.is_empty() { + options.remove(k); + } else { + options.insert(k.to_string(), v.to_string()); + } } }) .count();