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 {
- +