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() { async load() {
try {
await super.load(); await super.load();
type clusterStateSync = { type clusterStateSync = {
id: string; id: string;
state: ClusterState; state: ClusterState;
@ -155,6 +157,11 @@ export class ClusterStore extends BaseStore<ClusterStoreModel> {
return states; return states;
}); });
} }
} catch (error) {
logger.error("[CLUSTER-STORE] error loading: ", error);
this.fromStore();
this.isLoaded = true;
}
} }
protected pushStateToViewsAutomatically() { protected pushStateToViewsAutomatically() {

View File

@ -160,6 +160,7 @@ export class WorkspaceStore extends BaseStore<WorkspaceStoreModel> {
} }
async load() { async load() {
try {
await super.load(); await super.load();
type workspaceStateSync = { type workspaceStateSync = {
id: string; id: string;
@ -191,6 +192,9 @@ export class WorkspaceStore extends BaseStore<WorkspaceStoreModel> {
return states; return states;
}); });
} }
} catch (error) {
logger.error("[WORKSPACE-STORE] error loading: ", { error });
}
} }
registerIpcListener() { registerIpcListener() {

View File

@ -103,7 +103,7 @@ app.on("ready", async () => {
logger.info("💾 Loading stores"); logger.info("💾 Loading stores");
// preload // preload
await Promise.all([ await Promise.allSettled([
userStore.load(), userStore.load(),
clusterStore.load(), clusterStore.load(),
workspaceStore.load(), workspaceStore.load(),