From f1bfd00a468948f279cb0a0b1748fb6ba846524d Mon Sep 17 00:00:00 2001 From: gokhangunduz Date: Wed, 20 Dec 2023 14:17:22 +0300 Subject: [PATCH] refactor(connections): :tada: add ros connection control functions --- package.json | 2 +- src/components/Connections/Connections.tsx | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 9947c101..7e98a2fd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ui", - "version": "0.23.7", + "version": "0.23.8", "private": true, "scripts": { "dev": "react-scripts start", diff --git a/src/components/Connections/Connections.tsx b/src/components/Connections/Connections.tsx index 56b56d51..74462755 100644 --- a/src/components/Connections/Connections.tsx +++ b/src/components/Connections/Connections.tsx @@ -21,7 +21,10 @@ export default function Connections(): ReactElement { }); rosClient.on("connection", () => setIsRosConnected(true)); - rosClient.on("error", () => setIsRosConnected(false)); + rosClient.on( + "error", + () => isRosConnected === null && setIsRosConnected(false), + ); } function closeRosConnection() {