fix: Multiple API calls when bypassing /login

This commit is contained in:
Alexander Polynomdivision
2018-09-23 16:30:14 +02:00
parent 08cd51c2a3
commit be7a616fb5
7 changed files with 41 additions and 13 deletions

View File

@@ -4,7 +4,7 @@ import { IUser } from "../models/user";
import Application from "../components/app";
import { setAuthenticated, setUser } from "../actions";
import { setAuthenticated, setUser, setDidLogin } from "../actions";
const mapStateToProps = state => {
return {
@@ -15,6 +15,7 @@ const mapStateToProps = state => {
const mapDispatchToProps = dispatch => {
return {
setAuthenticated: (status: boolean) => dispatch(setAuthenticated(status)),
setDidLogin: (state: boolean) => dispatch(setDidLogin(state)),
setUser: (user: IUser) => dispatch(setUser(user)),
};
};

View File

@@ -10,6 +10,7 @@ const mapStateToProps = state => {
snackOpen: state.login.snackOpen,
snackMsg: state.login.snackMsg,
authenticated: state.authenticated,
didLogin: state.didLogin,
};
};
const mapDispatchToProps = dispatch => {