From e7511a41ec009904eab7b642a307b6f06b21bd64 Mon Sep 17 00:00:00 2001 From: Jari Kolehmainen Date: Mon, 20 Apr 2020 07:32:53 +0300 Subject: [PATCH] Always refresh stores when object list is mounted (#277) Signed-off-by: Jari Kolehmainen --- .../client/components/item-object-list/item-list-layout.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dashboard/client/components/item-object-list/item-list-layout.tsx b/dashboard/client/components/item-object-list/item-list-layout.tsx index 30c8a5717b..06cda88045 100644 --- a/dashboard/client/components/item-object-list/item-list-layout.tsx +++ b/dashboard/client/components/item-object-list/item-list-layout.tsx @@ -114,9 +114,7 @@ export class ItemListLayout extends React.Component { 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