mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Moved navigate statement into workspace renderer component
Signed-off-by: Steve Richards <srichards@mirantis.com>
This commit is contained in:
parent
8adf683056
commit
fbcb656237
@ -3,7 +3,6 @@ import { BaseStore } from "./base-store";
|
||||
import { clusterStore } from "./cluster-store"
|
||||
import { landingURL } from "../renderer/components/+landing-page/landing-page.route";
|
||||
import { navigate } from "../renderer/navigation";
|
||||
import { clusterViewURL } from "../renderer/components/cluster-manager/cluster-view.route";
|
||||
|
||||
export type WorkspaceId = string;
|
||||
export type ClusterId = string;
|
||||
@ -82,7 +81,6 @@ export class WorkspaceStore extends BaseStore<WorkspaceStoreModel> {
|
||||
if (resetActiveCluster) {
|
||||
if (clusterId) {
|
||||
clusterStore.setActive(clusterId)
|
||||
navigate(clusterViewURL({ params: { clusterId } }));
|
||||
} else {
|
||||
clusterStore.setActive(null)
|
||||
if (redirectToLanding) {
|
||||
|
||||
@ -10,6 +10,8 @@ import { observable } from "mobx";
|
||||
import { workspaceStore, WorkspaceId } from "../../../common/workspace-store";
|
||||
import { cssNames } from "../../utils";
|
||||
import { clusterStore } from "../../../common/cluster-store";
|
||||
import { navigate } from "../../navigation";
|
||||
import { clusterViewURL } from "../cluster-manager/cluster-view.route";
|
||||
|
||||
interface Props extends Partial<MenuProps> {
|
||||
}
|
||||
@ -23,6 +25,8 @@ export class WorkspaceMenu extends React.Component<Props> {
|
||||
workspaceStore.setLastActiveClusterId(workspaceStore.currentWorkspaceId, clusterStore.activeClusterId);
|
||||
}
|
||||
workspaceStore.setActive(id);
|
||||
const clusterId = workspaceStore.currentWorkspace.lastActiveClusterId;
|
||||
navigate(clusterViewURL({ params: { clusterId } }));
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user