diff --git a/Cargo.lock b/Cargo.lock index e62b9ba..79bcfb8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5434,6 +5434,7 @@ dependencies = [ "muda", "rfd", "tempfile", + "tokio", "url", "zeroize", ] diff --git a/apps/desktop/Cargo.toml b/apps/desktop/Cargo.toml index 0b35c27..5ee9c8a 100644 --- a/apps/desktop/Cargo.toml +++ b/apps/desktop/Cargo.toml @@ -30,6 +30,7 @@ path = "src/main.rs" [dependencies] iced.workspace = true ironstorage = { workspace = true, features = ["ssh"] } +tokio.workspace = true zeroize.workspace = true [target.'cfg(target_os = "macos")'.dependencies] diff --git a/apps/desktop/src/main.rs b/apps/desktop/src/main.rs index 7238a7e..e8a397f 100644 --- a/apps/desktop/src/main.rs +++ b/apps/desktop/src/main.rs @@ -6275,9 +6275,13 @@ fn parse_generation_length(value: &str) -> Result, String> async fn load_authentication() -> Result<(DesktopStorage, NativeAuthenticationSession, KeyInfo), String> { - DesktopStorage::system() - .map(|bootstrap| bootstrap.into_parts()) - .map_err(|error| error.to_string()) + tokio::task::spawn_blocking(|| { + DesktopStorage::system() + .map(|bootstrap| bootstrap.into_parts()) + .map_err(|error| error.to_string()) + }) + .await + .map_err(|error| format!("desktop startup task failed: {error}"))? } fn load_document(