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

fix: reloading stores when preloading enabled and waitUntilLoaded=false

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman 2021-02-02 19:32:17 +02:00
parent 59bb3ee3f9
commit b75b0e1ab3

View File

@ -161,13 +161,17 @@ export class KubeWatchApi {
apis.forEach(api => unsubscribeList.push(this.subscribeApi(api))); apis.forEach(api => unsubscribeList.push(this.subscribeApi(api)));
}; };
if (preloading && waitUntilLoaded) { if (preloading) {
preloading.loading.then(subscribe, error => { if (waitUntilLoaded) {
this.log({ preloading.loading.then(subscribe, error => {
message: new Error("Loading stores has failed"), this.log({
meta: { stores, error, options }, message: new Error("Loading stores has failed"),
meta: { stores, error, options },
});
}); });
}); } else {
subscribe();
}
// reload when context namespaces changes // reload when context namespaces changes
cancelReloading = reaction(() => this.namespaces, () => { cancelReloading = reaction(() => this.namespaces, () => {
@ -176,8 +180,6 @@ export class KubeWatchApi {
}, { }, {
equals: comparer.shallow, equals: comparer.shallow,
}); });
} else {
subscribe();
} }
// unsubscribe // unsubscribe