mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-08-25 12:54:09 +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
@@ -1,4 +1,3 @@
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import type { GrpcConnection, GrpcEvent } from "@yaakapp-internal/models";
|
||||
import {
|
||||
grpcConnectionsAtom,
|
||||
@@ -11,6 +10,7 @@ import { useEffect, useMemo } from "react";
|
||||
import { fireAndForget } from "../lib/fireAndForget";
|
||||
import { atomWithKVStorage } from "../lib/atoms/atomWithKVStorage";
|
||||
import { activeRequestIdAtom } from "./useActiveRequestId";
|
||||
import { rpc } from "../lib/rpc";
|
||||
|
||||
const pinnedGrpcConnectionIdsAtom = atomWithKVStorage<Record<string, string | null>>(
|
||||
"pinned-grpc-connection-ids",
|
||||
@@ -71,7 +71,7 @@ export function useGrpcEvents(connectionId: string | null) {
|
||||
|
||||
// Fetch events from database, filtering out events from other connections and merging atomically
|
||||
fireAndForget(
|
||||
invoke<GrpcEvent[]>("models_grpc_events", { connectionId }).then((events) =>
|
||||
rpc<GrpcEvent[]>("models_grpc_events", { connectionId }).then((events) =>
|
||||
mergeModelsInStore("grpc_event", events, (e) => e.connectionId === connectionId),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user