correct reloading of index resources after logn/logout

This commit is contained in:
Maren Süwer
2018-10-11 12:15:18 +02:00
parent 8a3c5ce21d
commit 313aed72b3
3 changed files with 9 additions and 9 deletions

View File

@@ -46,7 +46,6 @@ type Props = {
// dispatcher props
login: (link: string, username: string, password: string) => void,
fetchIndexResources: () => void,
// context props
t: string => string,
@@ -94,7 +93,6 @@ class Login extends React.Component<Props, State> {
}
renderRedirect = () => {
this.props.fetchIndexResources();
const { from } = this.props.location.state || { from: { pathname: "/" } };
return <Redirect to={from} />;
};
@@ -165,8 +163,7 @@ const mapStateToProps = state => {
const mapDispatchToProps = dispatch => {
return {
login: (loginLink: string, username: string, password: string) =>
dispatch(login(loginLink, username, password)),
fetchIndexResources: () => dispatch(fetchIndexResources())
dispatch(login(loginLink, username, password))
};
};