From 6af173711af2ca942a43ba36bab0f368840c41bf Mon Sep 17 00:00:00 2001 From: gokhangunduz Date: Wed, 20 Dec 2023 13:29:40 +0300 Subject: [PATCH] refactor(connections): :tada: add ros connection control functions --- package.json | 2 +- src/components/Connections/Connections.tsx | 4 ++++ src/layouts/EnvironmentPageLayout/EnvironmentPageLayout.tsx | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 0581c9d7..2d549b6a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ui", - "version": "0.23.4", + "version": "0.23.5", "private": true, "scripts": { "dev": "react-scripts start", diff --git a/src/components/Connections/Connections.tsx b/src/components/Connections/Connections.tsx index 9ff866f7..44ca4f09 100644 --- a/src/components/Connections/Connections.tsx +++ b/src/components/Connections/Connections.tsx @@ -34,6 +34,10 @@ export default function Connections(): ReactElement { } else { rosClient?.close(); } + + return () => { + rosClient?.close(); + }; }, [ isRobotReady, isSettedCookie, diff --git a/src/layouts/EnvironmentPageLayout/EnvironmentPageLayout.tsx b/src/layouts/EnvironmentPageLayout/EnvironmentPageLayout.tsx index 01d34f9e..4f4f8275 100644 --- a/src/layouts/EnvironmentPageLayout/EnvironmentPageLayout.tsx +++ b/src/layouts/EnvironmentPageLayout/EnvironmentPageLayout.tsx @@ -2,7 +2,7 @@ import { Fragment, ReactElement } from "react"; import EnvironmentHeader from "../../components/EnvironmentHeader/EnvironmentHeader"; import HiddenFrame from "../../components/HiddenFrame/HiddenFrame"; import { envApplication } from "../../helpers/envProvider"; -import RosConnector from "../../components/RosConnector/RosConnector"; +// import RosConnector from "../../components/RosConnector/RosConnector"; import Overview from "../../pages/EnvironmentPage/Overview/Overview"; import MissionContext from "../../contexts/MissionContext"; import BarcodeContext from "../../contexts/BarcodeContext"; @@ -24,7 +24,7 @@ export default function EnvironmentPageLayout(): ReactElement {
- {!envApplication && } + {/* {!envApplication && } */} {(() => { switch (activeTab) {