gitbutler/crates/gitbutler-tauri/src/askpass.rs
2024-04-04 11:49:12 +02:00

22 lines
535 B
Rust

pub mod commands {
use gitbutler_core::{
askpass::{AskpassBroker, AskpassRequest},
id::Id,
};
use tauri::{AppHandle, Manager};
#[tauri::command(async)]
#[tracing::instrument(skip(handle, response))]
pub async fn submit_prompt_response(
handle: AppHandle,
id: Id<AskpassRequest>,
response: Option<String>,
) -> Result<(), ()> {
handle
.state::<AskpassBroker>()
.handle_response(id, response)
.await;
Ok(())
}
}