diff --git a/nym-wallet/src-tauri/src/operations/app/link.rs b/nym-wallet/src-tauri/src/operations/app/link.rs index fa41aa8f19..ef309a0030 100644 --- a/nym-wallet/src-tauri/src/operations/app/link.rs +++ b/nym-wallet/src-tauri/src/operations/app/link.rs @@ -4,8 +4,21 @@ use tauri_plugin_opener::OpenerExt; pub async fn open_url(url: String, app_handle: tauri::AppHandle) -> Result<(), String> { println!("Opening URL: {}", url); - match app_handle.opener().open_url(&url, None::<&str>) { - Ok(_) => Ok(()), - Err(err) => Err(format!("Failed to open URL: {}", err)), + #[cfg(target_os = "windows")] + { + // Windows needs shell capability + match app_handle.shell().open("", &url) { + Ok(_) => Ok(()), + Err(err) => Err(format!("Failed to open URL: {}", err)), + } + } + + #[cfg(not(target_os = "windows"))] + { + // macOS and Linux work well with opener + match app_handle.opener().open_url(&url, None::<&str>) { + Ok(_) => Ok(()), + Err(err) => Err(format!("Failed to open URL: {}", err)), + } } }