Route all app commands through a single RPC envelope (#542)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Gregory Schier
2026-08-14 14:16:14 -07:00
committed by GitHub
co-authored by Claude Fable 5
parent 1f91cddab9
commit 23e7229e63
37 changed files with 2473 additions and 395 deletions
+2 -2
View File
@@ -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() {