feat: upgrade codemirror to 6.39.13 and enhance host switching

This commit is contained in:
Bohdan Triapitsyn
2026-02-10 01:16:13 +02:00
parent 29eb71a7d5
commit b727f16b80
6 changed files with 68 additions and 16 deletions
+24
View File
@@ -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}");
}