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,11 +188,9 @@ export class WorkspaceStore extends BaseStore<WorkspaceStoreModel> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
setLastActiveClusterId(clusterId: ClusterId, workspaceId = this.currentWorkspaceId) {
|
setLastActiveClusterId(clusterId?: ClusterId, workspaceId = this.currentWorkspaceId) {
|
||||||
if (clusterId != null) {
|
|
||||||
this.getById(workspaceId).lastActiveClusterId = clusterId;
|
this.getById(workspaceId).lastActiveClusterId = clusterId;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@action
|
@action
|
||||||
protected fromStore({ currentWorkspace, workspaces = [] }: WorkspaceStoreModel) {
|
protected fromStore({ currentWorkspace, workspaces = [] }: WorkspaceStoreModel) {
|
||||||
|
|||||||
@ -57,11 +57,7 @@ export class ClustersMenu extends React.Component<Props> {
|
|||||||
menu.append(new MenuItem({
|
menu.append(new MenuItem({
|
||||||
label: _i18n._(t`Disconnect`),
|
label: _i18n._(t`Disconnect`),
|
||||||
click: async () => {
|
click: async () => {
|
||||||
const lastActiveClusterId = workspaceStore.currentWorkspace.lastActiveClusterId;
|
|
||||||
if (clusterStore.isActive(cluster.id)) {
|
if (clusterStore.isActive(cluster.id)) {
|
||||||
if (lastActiveClusterId === cluster.id) {
|
|
||||||
workspaceStore.setLastActiveClusterId("");
|
|
||||||
}
|
|
||||||
navigate(landingURL());
|
navigate(landingURL());
|
||||||
clusterStore.setActive(null);
|
clusterStore.setActive(null);
|
||||||
}
|
}
|
||||||
@ -79,12 +75,9 @@ export class ClustersMenu extends React.Component<Props> {
|
|||||||
label: _i18n._(t`Remove`),
|
label: _i18n._(t`Remove`),
|
||||||
},
|
},
|
||||||
ok: () => {
|
ok: () => {
|
||||||
const lastActiveClusterId = workspaceStore.currentWorkspace.lastActiveClusterId;
|
|
||||||
if (lastActiveClusterId === cluster.id) {
|
|
||||||
workspaceStore.setLastActiveClusterId("");
|
|
||||||
}
|
|
||||||
if (clusterStore.activeClusterId === cluster.id) {
|
if (clusterStore.activeClusterId === cluster.id) {
|
||||||
navigate(landingURL());
|
navigate(landingURL());
|
||||||
|
clusterStore.setActive(null);
|
||||||
}
|
}
|
||||||
clusterStore.removeById(cluster.id);
|
clusterStore.removeById(cluster.id);
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user