From 17f94c58c7f6796f924abd44ae2e216fb2974877 Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Tue, 16 Mar 2021 10:59:36 -0400 Subject: [PATCH] fix build Signed-off-by: Sebastian Malton --- src/common/workspace-store.ts | 4 ++-- .../components/+landing-page/landing-page.tsx | 12 ++++-------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/common/workspace-store.ts b/src/common/workspace-store.ts index 45bc857da2..818288d5fb 100644 --- a/src/common/workspace-store.ts +++ b/src/common/workspace-store.ts @@ -132,9 +132,9 @@ export class Workspace implements WorkspaceModel, WorkspaceState { Object.assign(this, state); } - @action [updateFromModel](model: WorkspaceModel) { + [updateFromModel] = action((model: WorkspaceModel) => { Object.assign(this, model); - } + }); toJSON(): WorkspaceModel { return toJS({ diff --git a/src/renderer/components/+landing-page/landing-page.tsx b/src/renderer/components/+landing-page/landing-page.tsx index 15e22b2c9f..830c0eb714 100644 --- a/src/renderer/components/+landing-page/landing-page.tsx +++ b/src/renderer/components/+landing-page/landing-page.tsx @@ -3,7 +3,7 @@ import React from "react"; import { computed, observable } from "mobx"; import { observer } from "mobx-react"; import { clusterStore } from "../../../common/cluster-store"; -import { Workspace, workspaceStore } from "../../../common/workspace-store"; +import { workspaceStore } from "../../../common/workspace-store"; import { WorkspaceOverview } from "./workspace-overview"; import { PageLayout } from "../layout/page-layout"; import { Notifications } from "../notifications"; @@ -13,13 +13,9 @@ import { Icon } from "../icon"; export class LandingPage extends React.Component { @observable showHint = true; - get workspace(): Workspace { - return workspaceStore.currentWorkspace; - } - @computed get clusters() { - return clusterStore.getByWorkspaceId(this.workspace.id); + return clusterStore.getByWorkspaceId(workspaceStore.currentWorkspaceId); } componentDidMount() { @@ -36,11 +32,11 @@ export class LandingPage extends React.Component { render() { const showBackButton = this.clusters.length > 0; - const header = <>

{this.workspace.name}

; + const header = <>

{workspaceStore.currentWorkspace.name}

; return ( - + ); }