perf: add eventbus unmount in more places and optimise stats tab

This commit is contained in:
David Ralph
2021-08-20 22:06:40 +01:00
parent afcead634b
commit ef2f666ccf
12 changed files with 26 additions and 10 deletions

View File

@@ -19,12 +19,16 @@ export default class Stats extends PureComponent {
if (localStorage.getItem('stats') === 'false') {
localStorage.setItem('statsData', JSON.stringify({}));
return this.setState({
stats: JSON.parse(localStorage.getItem('statsData')) || {}
stats: {}
});
}
this.forceUpdate();
}
})
});
}
componentWillUnmount() {
EventBus.off('refresh');
}
render() {

View File

@@ -81,6 +81,10 @@ export default class WelcomeModal extends PureComponent {
});
}
componentWillUnmount() {
EventBus.off('refresh');
}
render() {
return (
<div className='welcomeContent'>