Fix grpc/ws events error

This commit is contained in:
Gregory Schier
2025-05-16 13:00:50 -07:00
parent 42e70b941d
commit 432b366105
2 changed files with 15 additions and 1 deletions

View File

@@ -62,6 +62,11 @@ export function useGrpcEvents(connectionId: string | null) {
const events = useAtomValue(grpcEventsAtom);
useEffect(() => {
if (connectionId == null) {
replaceModelsInStore('grpc_event', []);
return;
}
invoke<GrpcEvent[]>('plugin:yaak-models|grpc_events', { connectionId }).then((events) => {
replaceModelsInStore('grpc_event', events);
});