diff --git a/src/renderer/components/+workspaces/workspaces.tsx b/src/renderer/components/+workspaces/workspaces.tsx index 4442a772e8..a482c78a95 100644 --- a/src/renderer/components/+workspaces/workspaces.tsx +++ b/src/renderer/components/+workspaces/workspaces.tsx @@ -13,6 +13,7 @@ import { Input } from "../input"; import { cssNames, prevDefault } from "../../utils"; import { Button } from "../button"; import { isRequired, InputValidator } from "../input/input_validators"; +import { clusterStore } from "../../../common/cluster-store"; @observer export class Workspaces extends React.Component { @@ -70,6 +71,12 @@ export class Workspaces extends React.Component { this.editingWorkspaces.set(id, toJS(workspace)); } + activateWorkspace = (id: WorkspaceId) => { + const clusterId = workspaceStore.getById(id).lastActiveClusterId; + workspaceStore.setActive(id); + clusterStore.setActive(clusterId); + } + clearEditing = (id: WorkspaceId) => { this.editingWorkspaces.delete(id); } @@ -135,7 +142,7 @@ export class Workspaces extends React.Component { {!isEditing && ( - workspaceStore.setActive(workspaceId))}>{name} + this.activateWorkspace(workspaceId))}>{name} {isActive && (current)} {description}