mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-08-25 21:04:04 +02:00
Route all app commands through a single RPC envelope (#542)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
1f91cddab9
commit
23e7229e63
@@ -49,13 +49,13 @@ fn setup_window_menu<R: Runtime>(win: &WebviewWindow<R>) {
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn rpc(
|
||||
async fn rpc(
|
||||
router: State<'_, RpcRouter<ProxyCtx>>,
|
||||
ctx: State<'_, ProxyCtx>,
|
||||
cmd: String,
|
||||
payload: serde_json::Value,
|
||||
) -> Result<serde_json::Value, String> {
|
||||
router.dispatch(&cmd, payload, &ctx).map_err(|e| e.message)
|
||||
router.dispatch(&cmd, payload, &ctx).await.map_err(|e| e.message)
|
||||
}
|
||||
|
||||
pub fn run() {
|
||||
|
||||
Reference in New Issue
Block a user