Fix command to check if a daemon is running

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/4/head
trivernis 3 years ago
parent 305ac256d1
commit 778bb2fe77

@ -21,5 +21,9 @@ pub async fn start_daemon(app_state: AppAccess<'_>, repo_path: String) -> Plugin
#[tauri::command] #[tauri::command]
pub async fn check_daemon_running(address: String) -> PluginResult<bool> { pub async fn check_daemon_running(address: String) -> PluginResult<bool> {
Ok(ApiClient::connect(&address).await.is_ok()) if let Ok(api_client) = ApiClient::connect(&address).await {
Ok(api_client.info().await.is_ok())
} else {
Ok(false)
}
} }

Loading…
Cancel
Save