mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
switch to last active cluster when workspace change
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
1 parent
b4cd9bd0bf
commit
4aa51ae5b2
2 files changed
+10
-2
No files matched your search
@@ -243,7 +243,6 @@ export class WorkspaceStore extends BaseStore<WorkspaceStoreModel> {
|
|||||||
throw new Error(`workspace ${id} doesn't exist`);
|
throw new Error(`workspace ${id} doesn't exist`);
|
||||||
}
|
}
|
||||||
this.currentWorkspaceId = id;
|
this.currentWorkspaceId = id;
|
||||||
clusterStore.setActive(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import { CommandOverlay } from "../command-palette/command-container";
|
|||||||
import { AddWorkspace } from "./add-workspace";
|
import { AddWorkspace } from "./add-workspace";
|
||||||
import { RemoveWorkspace } from "./remove-workspace";
|
import { RemoveWorkspace } from "./remove-workspace";
|
||||||
import { EditWorkspace } from "./edit-workspace";
|
import { EditWorkspace } from "./edit-workspace";
|
||||||
|
import { landingURL } from "../+landing-page";
|
||||||
|
import { clusterViewURL } from "../cluster-manager/cluster-view.route";
|
||||||
|
|
||||||
@observer
|
@observer
|
||||||
export class ChooseWorkspace extends React.Component {
|
export class ChooseWorkspace extends React.Component {
|
||||||
@@ -54,7 +56,14 @@ export class ChooseWorkspace extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
workspaceStore.setActive(id);
|
workspaceStore.setActive(id);
|
||||||
navigate("/");
|
const clusterId = workspaceStore.getById(id).lastActiveClusterId;
|
||||||
|
|
||||||
|
if (clusterId) {
|
||||||
|
navigate(clusterViewURL({ params: { clusterId } }));
|
||||||
|
} else {
|
||||||
|
navigate(landingURL());
|
||||||
|
}
|
||||||
|
|
||||||
CommandOverlay.close();
|
CommandOverlay.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user