fix(ui): fixed hostname option in sandbox settings

This commit is contained in:
Observer KRypt0n_ 2023-04-16 15:00:05 +02:00
parent f42a91c0ea
commit f64d60128c
No known key found for this signature in database
GPG key ID: 844DA47BA25FE1E2
2 changed files with 17 additions and 2 deletions

View file

@ -94,13 +94,13 @@ impl SimpleAsyncComponent for EnvironmentApp {
connect_changed => |entry| {
if let Ok(mut config) = Config::get() {
let command = entry.text().trim().to_string();
config.game.command = if command.is_empty() {
None
} else {
Some(command)
};
Config::update(config);
}
}

View file

@ -191,6 +191,21 @@ impl SimpleAsyncComponent for SandboxApp {
adw::EntryRow {
set_title: &tr("hostname"),
set_text: CONFIG.sandbox.hostname.as_ref().unwrap_or(&String::new()).trim(),
connect_changed => |entry| {
if let Ok(mut config) = Config::get() {
let command = entry.text().trim().to_string();
config.sandbox.hostname = if command.is_empty() {
None
} else {
Some(command)
};
Config::update(config);
}
}
}
},