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

Fix resource lists auto-refresh (#447)

Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
Lauri Nevala 2020-06-11 16:22:09 +03:00 committed by GitHub
parent 8e514df70e
commit 1fbca3fcd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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() {