1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Fix resource lists auto-refresh

Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
Lauri Nevala 2020-06-11 16:01:12 +03:00
parent 0888ad8c5d
commit 4eefd900e9

View File

@ -117,12 +117,11 @@ export class ItemListLayout extends React.Component<ItemListLayoutProps> {
try { try {
await Promise.all(stores.map(store => store.loadAll())); await Promise.all(stores.map(store => store.loadAll()));
const subscriptions = stores.map(store => store.subscribe()); const subscriptions = stores.map(store => store.subscribe());
await when(() => this.isUnmounting);
subscriptions.forEach(dispose => dispose()); // unsubscribe all subscriptions.forEach(dispose => dispose()); // unsubscribe all
} catch(error) { } catch(error) {
console.log("catched", error) console.log("catched", error)
} }
await when(() => this.isUnmounting);
} }
componentWillUnmount() { componentWillUnmount() {