feat: upgrade codemirror to 6.39.13 and enhance host switching
This commit is contained in:
@@ -1121,6 +1121,7 @@ async fn desktop_host_probe(url: String) -> Result<HostProbeResult, String> {
|
||||
.build()
|
||||
.map_err(|err| err.to_string())?;
|
||||
let started = std::time::Instant::now();
|
||||
|
||||
match client.get(&health).send().await {
|
||||
Ok(resp) => {
|
||||
let status = resp.status();
|
||||
@@ -2086,6 +2087,29 @@ fn main() {
|
||||
}
|
||||
}
|
||||
|
||||
if initial_url != local_ui_url {
|
||||
match desktop_host_probe(initial_url.clone()).await {
|
||||
Ok(probe) if probe.status != "unreachable" => {}
|
||||
Ok(_) => {
|
||||
log::warn!(
|
||||
"[desktop] startup host unreachable ({}), falling back to local ({})",
|
||||
initial_url,
|
||||
local_ui_url
|
||||
);
|
||||
initial_url = local_ui_url.clone();
|
||||
}
|
||||
Err(err) => {
|
||||
log::warn!(
|
||||
"[desktop] startup host probe failed ({}): {}, falling back to local ({})",
|
||||
initial_url,
|
||||
err,
|
||||
local_ui_url
|
||||
);
|
||||
initial_url = local_ui_url.clone();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if let Err(err) = create_main_window(&handle, &initial_url, &local_origin) {
|
||||
log::error!("[desktop] failed to create window: {err}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user