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:
parent
8e514df70e
commit
1fbca3fcd3
@ -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() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user