From f5d63d8235debdae07636c6a5191f8b7c5b838fa Mon Sep 17 00:00:00 2001 From: Star Richardson <67430892+alicenstar@users.noreply.github.com> Date: Fri, 20 Oct 2023 13:58:24 -0600 Subject: [PATCH] fix config redirect, remove unnecessary code (#4104) * fix config redirect, remove unnecessary code * linting --- web/src/Root.tsx | 7 +------ web/src/components/apps/HelmVMClusterManagement.tsx | 6 +++--- web/src/components/apps/HelmVMViewNode.jsx | 11 +---------- 3 files changed, 5 insertions(+), 19 deletions(-) diff --git a/web/src/Root.tsx b/web/src/Root.tsx index 54e86f9a31..a78e3b46bc 100644 --- a/web/src/Root.tsx +++ b/web/src/Root.tsx @@ -579,12 +579,7 @@ const Root = () => { <> - } + element={} /> { const [state, setState] = useReducer( (prevState: State, newState: Partial) => ({ @@ -81,7 +79,9 @@ const HelmVMClusterManagement = ({ const [selectedNodeTypes, setSelectedNodeTypes] = useState([]); const { data: appsData } = useApps(); - const app = appsData?.apps?.find((a) => a.name === appName); + // we grab the first app because helmvm users should only ever have one app + const app = appsData?.apps?.[0]; + const { slug } = useParams(); // #region queries diff --git a/web/src/components/apps/HelmVMViewNode.jsx b/web/src/components/apps/HelmVMViewNode.jsx index 66396d8b10..6bd7651568 100644 --- a/web/src/components/apps/HelmVMViewNode.jsx +++ b/web/src/components/apps/HelmVMViewNode.jsx @@ -1,5 +1,5 @@ import { MaterialReactTable } from "material-react-table"; -import React, { useMemo } from "react"; +import React, { useMemo, setState } from "react"; import { useQuery } from "@tanstack/react-query"; import { Link, useParams } from "react-router-dom"; import Loader from "@components/shared/Loader"; @@ -62,15 +62,6 @@ const HelmVMViewNode = () => { err.status ); }, - onSuccess: (data) => { - setState({ - // if cluster doesn't support ha, then primary will be disabled. Force into secondary - selectedNodeType: !data.ha ? "secondary" : state.selectedNodeType, - }); - }, - config: { - retry: false, - }, }); const node = nodeData || testData;