mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-08-25 21:04:04 +02:00
Add a typed platform package to decouple the frontend from Tauri (#539)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
0068be9ffc
commit
2383f06e71
@@ -6,7 +6,7 @@ import type {
|
||||
WebsocketRequestAction,
|
||||
} from "@yaakapp-internal/plugins";
|
||||
import { useMemo } from "react";
|
||||
import { invokeCmd } from "../lib/tauri";
|
||||
import { rpc } from "../lib/rpc";
|
||||
import { usePluginsKey } from "./usePlugins";
|
||||
|
||||
export type CallableWebSocketRequestAction = Pick<WebsocketRequestAction, "label" | "icon"> & {
|
||||
@@ -30,7 +30,7 @@ export function useWebsocketRequestActions() {
|
||||
}
|
||||
|
||||
export async function getWebsocketRequestActions() {
|
||||
const responses = await invokeCmd<GetWebsocketRequestActionsResponse[]>(
|
||||
const responses = await rpc<GetWebsocketRequestActionsResponse[]>(
|
||||
"cmd_websocket_request_actions",
|
||||
);
|
||||
const actions = responses.flatMap((r) =>
|
||||
@@ -43,7 +43,7 @@ export async function getWebsocketRequestActions() {
|
||||
pluginRefId: r.pluginRefId,
|
||||
args: { websocketRequest },
|
||||
};
|
||||
await invokeCmd("cmd_call_websocket_request_action", { req: payload });
|
||||
await rpc("cmd_call_websocket_request_action", { req: payload });
|
||||
},
|
||||
})),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user