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)));
};
if (preloading && waitUntilLoaded) {
preloading.loading.then(subscribe, error => {
this.log({
message: new Error("Loading stores has failed"),
meta: { stores, error, options },
if (preloading) {
if (waitUntilLoaded) {
preloading.loading.then(subscribe, error => {
this.log({
message: new Error("Loading stores has failed"),
meta: { stores, error, options },
});
});
});
} else {
subscribe();
}
// reload when context namespaces changes
cancelReloading = reaction(() => this.namespaces, () => {
@ -176,8 +180,6 @@ export class KubeWatchApi {
}, {
equals: comparer.shallow,
});
} else {
subscribe();
}
// unsubscribe