+
{leftSlot({ style: areaL, orientation: vertical ? 'vertical' : 'horizontal' })}
([]);
const [activeConnectionId, setActiveConnectionId] = useState(null);
+
useListenToTauriEvent(
'grpc_message',
(event) => {
@@ -28,8 +27,9 @@ export function useGrpc(url: string | null) {
{ message: event.payload, time: new Date(), type: 'server' },
]);
},
- [],
+ [setMessages],
);
+
const unary = useMutation({
mutationKey: ['grpc_unary', url],
mutationFn: async ({ service, method, message }) => {
@@ -94,8 +94,8 @@ export function useGrpc(url: string | null) {
const cancel = useMutation({
mutationKey: ['grpc_cancel', url],
mutationFn: async () => {
- await emit('grpc_message_in', 'Cancel');
setActiveConnectionId(null);
+ await emit('grpc_message_in', 'Cancel');
setMessages((m) => [
...m,
{ type: 'info', message: 'Cancelled by client', time: new Date() },