attempt to recover the ui after failing to load cluster store

Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com>
This commit is contained in:
Jim Ehrismann committed 2021-02-26 20:37:24 -05:00
1 parent b3176a6fc4
commit c19f0b182b
3 files changed
+12 -1

No files matched your search

+7
View File
@@ -124,7 +124,9 @@ export class ClusterStore extends BaseStore<ClusterStoreModel> {
}
async load() {
try {
await super.load();
type clusterStateSync = {
id: string;
state: ClusterState;
@@ -155,6 +157,11 @@ export class ClusterStore extends BaseStore<ClusterStoreModel> {
return states;
});
}
} catch (error) {
logger.error("[CLUSTER-STORE] error loading: ", error);
this.fromStore();
this.isLoaded = true;
}
}
protected pushStateToViewsAutomatically() {
+4
View File
@@ -160,6 +160,7 @@ export class WorkspaceStore extends BaseStore<WorkspaceStoreModel> {
}
async load() {
try {
await super.load();
type workspaceStateSync = {
id: string;
@@ -191,6 +192,9 @@ export class WorkspaceStore extends BaseStore<WorkspaceStoreModel> {
return states;
});
}
} catch (error) {
logger.error("[WORKSPACE-STORE] error loading: ", { error });
}
}
registerIpcListener() {
+1 -1
View File
@@ -103,7 +103,7 @@ app.on("ready", async () => {
logger.info("💾 Loading stores");
// preload
await Promise.all([
await Promise.allSettled([
userStore.load(),
clusterStore.load(),
workspaceStore.load(),