mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Cleaning up more
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
c76b4d59d5
commit
5f5b1efadb
@ -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<CatalogViewRouteParam>(catalogRoute.path);
|
||||
|
||||
export const browseCatalogTab = "browse";
|
||||
|
||||
@ -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 {
|
||||
<main>
|
||||
<div id="lens-views"/>
|
||||
<Switch>
|
||||
<Redirect exact from={catalogURL()} to={`${catalogURL()}/${previousActiveTab.get() || browseCatalogTab}`}/>
|
||||
<Redirect exact from={catalogURL()} to={getPreviousTabUrl(previousActiveTab.get())}/>
|
||||
<Route component={Welcome} {...routes.welcomeRoute} />
|
||||
<Route component={Catalog} {...routes.catalogRoute} />
|
||||
<Route component={Preferences} {...routes.preferencesRoute} />
|
||||
|
||||
Loading…
Reference in New Issue
Block a user