mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Cleaning up
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
4e43506577
commit
8e9cd7baf1
@ -188,10 +188,8 @@ export class WorkspaceStore extends BaseStore<WorkspaceStoreModel> {
|
||||
}
|
||||
|
||||
@action
|
||||
setLastActiveClusterId(clusterId: ClusterId, workspaceId = this.currentWorkspaceId) {
|
||||
if (clusterId != null) {
|
||||
this.getById(workspaceId).lastActiveClusterId = clusterId;
|
||||
}
|
||||
setLastActiveClusterId(clusterId?: ClusterId, workspaceId = this.currentWorkspaceId) {
|
||||
this.getById(workspaceId).lastActiveClusterId = clusterId;
|
||||
}
|
||||
|
||||
@action
|
||||
|
||||
@ -57,11 +57,7 @@ export class ClustersMenu extends React.Component<Props> {
|
||||
menu.append(new MenuItem({
|
||||
label: _i18n._(t`Disconnect`),
|
||||
click: async () => {
|
||||
const lastActiveClusterId = workspaceStore.currentWorkspace.lastActiveClusterId;
|
||||
if (clusterStore.isActive(cluster.id)) {
|
||||
if (lastActiveClusterId === cluster.id) {
|
||||
workspaceStore.setLastActiveClusterId("");
|
||||
}
|
||||
navigate(landingURL());
|
||||
clusterStore.setActive(null);
|
||||
}
|
||||
@ -79,12 +75,9 @@ export class ClustersMenu extends React.Component<Props> {
|
||||
label: _i18n._(t`Remove`),
|
||||
},
|
||||
ok: () => {
|
||||
const lastActiveClusterId = workspaceStore.currentWorkspace.lastActiveClusterId;
|
||||
if (lastActiveClusterId === cluster.id) {
|
||||
workspaceStore.setLastActiveClusterId("");
|
||||
}
|
||||
if (clusterStore.activeClusterId === cluster.id) {
|
||||
navigate(landingURL());
|
||||
clusterStore.setActive(null);
|
||||
}
|
||||
clusterStore.removeById(cluster.id);
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user