fix: default empty or missing session proxy type to 'none'

This commit is contained in:
TomZz
2026-06-27 18:23:46 +08:00
parent 99b7fe30e4
commit 5c0c0cc701
2 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ pub struct Session {
pub passphrase: String,
#[serde(default)]
pub last_used: Option<String>,
#[serde(default)]
#[serde(default = "default_global_proxy_type")]
pub proxy_type: String, // "none", "socks5", "http"
#[serde(default)]
pub proxy_host: String,
+5 -1
View File
@@ -198,7 +198,11 @@ impl Ashell {
window,
cx,
);
self.ssh_proxy_type = session.proxy_type.clone();
self.ssh_proxy_type = if session.proxy_type.is_empty() {
"none".to_string()
} else {
session.proxy_type.clone()
};
Self::set_input_value(&self.proxy_host_input, session.proxy_host.clone(), window, cx);
Self::set_input_value(
&self.proxy_port_input,