From 85a7f1e323d2516fbdec880ec77f740496c5aa2f Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Tue, 1 Sep 2020 14:33:47 -0400 Subject: [PATCH] fix initial value not being saved Signed-off-by: Sebastian Malton --- src/common/cluster-store.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common/cluster-store.ts b/src/common/cluster-store.ts index bf5a0a84c2..f91757c72f 100644 --- a/src/common/cluster-store.ts +++ b/src/common/cluster-store.ts @@ -1,4 +1,4 @@ -import type { WorkspaceId } from "./workspace-store"; +import { WorkspaceId, workspaceStore } from "./workspace-store"; import path from "path"; import { app, ipcRenderer, remote } from "electron"; import { unlink } from "fs-extra"; @@ -120,6 +120,9 @@ export class ClusterStore extends BaseStore { } getByWorkspaceId(workspaceId: string): Cluster[] { + this.clusterOrders[workspaceId] ??= Array.from(this.clusters.values()) + .filter(cluster => cluster.workspace === workspaceId) + .map(cluster => cluster.id); return this.clusterOrders[workspaceId].map(clusterId => this.clusters.get(clusterId)); }