reset the redux state if the token is expired and the user still uses the web ui

This commit is contained in:
Eduard Heimbuch
2020-08-28 15:39:58 +02:00
parent daa5d459cf
commit 9ee7c3ff1c
3 changed files with 65 additions and 8 deletions

View File

@@ -64,6 +64,15 @@ class Index extends Component<Props, State> {
this.props.fetchIndexResources();
}
componentDidUpdate() {
const { indexResources, loading, error } = this.props;
const { pluginsLoaded } = this.state;
if (!indexResources && !loading && !error && pluginsLoaded) {
this.props.fetchIndexResources();
this.setState({ pluginsLoaded: false });
}
}
pluginLoaderCallback = () => {
this.setState({
pluginsLoaded: true