Skip to content

Commit

Permalink
refactor(connections): 🎉 add ros connection control functions
Browse files Browse the repository at this point in the history
  • Loading branch information
gokhangunduz committed Dec 20, 2023
1 parent 23e5a36 commit f1bfd00
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ui",
"version": "0.23.7",
"version": "0.23.8",
"private": true,
"scripts": {
"dev": "react-scripts start",
Expand Down
5 changes: 4 additions & 1 deletion src/components/Connections/Connections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit f1bfd00

Please sign in to comment.