From 5f5b1efadb5dbdbc542b82a1f353276fab8daaa8 Mon Sep 17 00:00:00 2001 From: Alex Andreev Date: Mon, 27 Sep 2021 07:54:56 +0300 Subject: [PATCH] Cleaning up more Signed-off-by: Alex Andreev --- src/common/routes/catalog.ts | 4 ++++ src/renderer/components/cluster-manager/cluster-manager.tsx | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/common/routes/catalog.ts b/src/common/routes/catalog.ts index 602b7a0c35..33923c26eb 100644 --- a/src/common/routes/catalog.ts +++ b/src/common/routes/catalog.ts @@ -30,6 +30,10 @@ export const catalogRoute: RouteProps = { path: "/catalog/:group?/:kind?" }; +export const getPreviousTabUrl = (path: string) => { + return `${catalogURL()}/${path || browseCatalogTab}`; +}; + export const catalogURL = buildURL(catalogRoute.path); export const browseCatalogTab = "browse"; diff --git a/src/renderer/components/cluster-manager/cluster-manager.tsx b/src/renderer/components/cluster-manager/cluster-manager.tsx index ec410e896b..2058707b99 100644 --- a/src/renderer/components/cluster-manager/cluster-manager.tsx +++ b/src/renderer/components/cluster-manager/cluster-manager.tsx @@ -40,7 +40,7 @@ import { reaction } from "mobx"; import { navigation } from "../../navigation"; import { setEntityOnRouteMatch } from "../../../main/catalog-sources/helpers/general-active-sync"; import { TopBar } from "../layout/topbar"; -import { browseCatalogTab, catalogURL } from "../../../common/routes"; +import { catalogURL, getPreviousTabUrl } from "../../../common/routes"; @observer export class ClusterManager extends React.Component { @@ -57,7 +57,7 @@ export class ClusterManager extends React.Component {
- +