diff --git a/src/common/cluster-store.ts b/src/common/cluster-store.ts index eda3f2c070..d1ccec355e 100644 --- a/src/common/cluster-store.ts +++ b/src/common/cluster-store.ts @@ -205,7 +205,9 @@ export class ClusterStore extends BaseStore { if (!(model instanceof Cluster)) { cluster = new Cluster(model); } - cluster.enabled = true; + if (!cluster.isManaged) { + cluster.enabled = true; + } this.clusters.set(model.id, cluster); return cluster; } diff --git a/src/common/workspace-store.ts b/src/common/workspace-store.ts index 4ce170e792..2994adb4a9 100644 --- a/src/common/workspace-store.ts +++ b/src/common/workspace-store.ts @@ -94,7 +94,6 @@ export class WorkspaceStore extends BaseStore { if (ipcRenderer) { logger.info("[WORKSPACE-STORE] requesting initial state sync"); const workspaceStates: workspaceStateSync[] = await requestMain(this.stateRequestChannel); - console.log(workspaceStates); workspaceStates.forEach((workspaceState) => { const workspace = this.getById(workspaceState.id); if (workspace) { @@ -182,7 +181,10 @@ export class WorkspaceStore extends BaseStore { return; } this.workspaces.set(id, workspace); - workspace.enabled = true; + if (!workspace.isManaged) { + workspace.enabled = true; + } + appEventBus.emit({name: "workspace", action: "add"}); return workspace; } diff --git a/src/renderer/components/cluster-manager/clusters-menu.tsx b/src/renderer/components/cluster-manager/clusters-menu.tsx index f030b8e039..c3c710f8d9 100644 --- a/src/renderer/components/cluster-manager/clusters-menu.tsx +++ b/src/renderer/components/cluster-manager/clusters-menu.tsx @@ -65,26 +65,28 @@ export class ClustersMenu extends React.Component { } })); } - menu.append(new MenuItem({ - label: _i18n._(t`Remove`), - click: () => { - ConfirmDialog.open({ - okButtonProps: { - primary: false, - accent: true, - label: _i18n._(t`Remove`), - }, - ok: () => { - if (clusterStore.activeClusterId === cluster.id) { - navigate(landingURL()); - clusterStore.setActive(null); - } - clusterStore.removeById(cluster.id); - }, - message:

Are you sure want to remove cluster {cluster.contextName}?

, - }); - } - })); + if (!cluster.isManaged) { + menu.append(new MenuItem({ + label: _i18n._(t`Remove`), + click: () => { + ConfirmDialog.open({ + okButtonProps: { + primary: false, + accent: true, + label: _i18n._(t`Remove`), + }, + ok: () => { + if (clusterStore.activeClusterId === cluster.id) { + navigate(landingURL()); + clusterStore.setActive(null); + } + clusterStore.removeById(cluster.id); + }, + message:

Are you sure want to remove cluster {cluster.contextName}?

, + }); + } + })); + } menu.popup({ window: remote.getCurrentWindow() });