fix: reloading stores when preloading enabled and waitUntilLoaded=false

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman committed 2021-02-02 19:32:17 +02:00
1 parent 59bb3ee3f9
commit b75b0e1ab3
1 file changed
+10 -8
+10 -8
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