1
0
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

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen 2020-04-19 12:45:08 +03:00
parent 799482b3c4
commit d1838b0215

View File

@ -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