mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
resubscribe stores on contextNamespace change
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
parent
a9227bd02e
commit
4400c2b260
@ -109,7 +109,10 @@ export class KubeWatchApi {
|
|||||||
// reload stores only for context namespaces change
|
// reload stores only for context namespaces change
|
||||||
cancelReloading = reaction(() => this.context?.contextNamespaces, namespaces => {
|
cancelReloading = reaction(() => this.context?.contextNamespaces, namespaces => {
|
||||||
preloading?.cancelLoading();
|
preloading?.cancelLoading();
|
||||||
|
unsubscribeList.forEach(unsubscribe => unsubscribe());
|
||||||
|
unsubscribeList.length = 0;
|
||||||
preloading = load(namespaces);
|
preloading = load(namespaces);
|
||||||
|
preloading.loading.then(subscribe);
|
||||||
}, {
|
}, {
|
||||||
equals: comparer.shallow,
|
equals: comparer.shallow,
|
||||||
});
|
});
|
||||||
@ -122,6 +125,7 @@ export class KubeWatchApi {
|
|||||||
cancelReloading();
|
cancelReloading();
|
||||||
preloading?.cancelLoading();
|
preloading?.cancelLoading();
|
||||||
unsubscribeList.forEach(unsubscribe => unsubscribe());
|
unsubscribeList.forEach(unsubscribe => unsubscribe());
|
||||||
|
unsubscribeList.length = 0;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user