From 4eefd900e9da23f9eef82dc0deed3e2296af33f1 Mon Sep 17 00:00:00 2001 From: Lauri Nevala Date: Thu, 11 Jun 2020 16:01:12 +0300 Subject: [PATCH] Fix resource lists auto-refresh Signed-off-by: Lauri Nevala --- .../client/components/item-object-list/item-list-layout.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 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 eb5dac108c..80c1f76d70 100644 --- a/dashboard/client/components/item-object-list/item-list-layout.tsx +++ b/dashboard/client/components/item-object-list/item-list-layout.tsx @@ -117,12 +117,11 @@ export class ItemListLayout extends React.Component { try { 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 } catch(error) { console.log("catched", error) } - await when(() => this.isUnmounting); } componentWillUnmount() {