mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-12 07:41:02 +03:00
fix strategy cannot apply over default advanced options (#14502)
Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
@@ -286,10 +286,14 @@ fn heartbeat_url() -> String {
|
||||
|
||||
fn handle_config_options(config_options: HashMap<String, String>) {
|
||||
let mut options = Config::get_options();
|
||||
let default_settings = config::DEFAULT_SETTINGS.read().unwrap().clone();
|
||||
config_options
|
||||
.iter()
|
||||
.map(|(k, v)| {
|
||||
if v.is_empty() {
|
||||
// Priority: user config > default advanced options.
|
||||
// Only when default advanced options are also empty, remove user option (fallback to built-in default);
|
||||
// otherwise insert an empty value so user config remains present.
|
||||
if v.is_empty() && default_settings.get(k).map_or("", |v| v).is_empty() {
|
||||
options.remove(k);
|
||||
} else {
|
||||
options.insert(k.to_string(), v.to_string());
|
||||
|
||||
Reference in New Issue
Block a user