fix reconnect, better handling no-clusters state

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman committed 2020-07-24 14:17:14 +03:00
1 parent 0490dc1d12
commit 408f64c184
12 files changed
+145 -138

No files matched your search

-8
View File
@@ -17,12 +17,4 @@ export const clusterIpc = {
return clusterStore.getById(clusterId)?.disconnect();
},
}),
reconnect: createIpcChannel({
channel: "cluster:reconnect",
handle: (clusterId: ClusterId = clusterStore.activeClusterId) => {
tracker.event("cluster", "reconnect");
return clusterStore.getById(clusterId)?.reconnect();
},
}),
}
+5
View File
@@ -197,3 +197,8 @@ export class ClusterStore extends BaseStore<ClusterStoreModel> {
}
export const clusterStore = ClusterStore.getInstance<ClusterStore>();
export function getHostedCluster(): Cluster {
const clusterId = location.hostname.split(".")[0];
return clusterStore.getById(clusterId);
}