1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

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 2021-02-26 20:37:24 -05:00
parent b3176a6fc4
commit c19f0b182b
3 changed files with 61 additions and 50 deletions

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() {

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() {

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(),