mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Always refresh stores when object list is mounted (#277)
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
parent
6bdd247a85
commit
e7511a41ec
@ -114,9 +114,7 @@ export class ItemListLayout extends React.Component<ItemListLayoutProps> {
|
||||
const { store, dependentStores, isClusterScoped } = this.props;
|
||||
const stores = [store, ...dependentStores];
|
||||
if (!isClusterScoped) stores.push(namespaceStore);
|
||||
const loadingStores = stores.filter(store => !store.isLoaded);
|
||||
loadingStores.forEach(store => store.loadAll());
|
||||
await when(() => loadingStores.every(store => !store.isLoading));
|
||||
await Promise.all(stores.map(store => store.loadAll()));
|
||||
const subscriptions = stores.map(store => store.subscribe());
|
||||
await when(() => this.isUnmounting);
|
||||
subscriptions.forEach(dispose => dispose()); // unsubscribe all
|
||||
|
||||
Loading…
Reference in New Issue
Block a user