diff --git a/src/container/Gone.js b/src/container/Gone.js index 600a010..a064e88 100644 --- a/src/container/Gone.js +++ b/src/container/Gone.js @@ -15,15 +15,15 @@ const Gone = (props) => ( {props.loggedIn ? 'Logged in': 'Nah anonymous'}
- + ) const mapStateToProps = state => ({ - token: getToken(state.auth) + token: getToken(state.auth), + loggedIn: loggedIn(state.auth), }) export default connect( - mapStateToProps, - { loggedIn, fetchAuth } + mapStateToProps )(Gone) diff --git a/src/reducers/auth.js b/src/reducers/auth.js index 07bc968..e6e6f2c 100644 --- a/src/reducers/auth.js +++ b/src/reducers/auth.js @@ -37,4 +37,4 @@ const token = (state = tokenInitialState, action) => { export default token export const getToken = state => state.token -export const loggedIn = state => state && state.token == null +export const loggedIn = state => state && state.token !== null