Don't update the state when action.reload === false

This commit is contained in:
Alex Gleason 2021-03-30 00:35:27 -05:00
parent 09cbcf6145
commit 15d61a98e7
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -167,11 +167,13 @@ export default function auth(oldState = initialState, action) {
// Persist the state in localStorage
persistAuth(state);
// Persist the session
if (action.reload !== false) {
persistSession(state);
if (action.reload === false) {
return oldState;
}
// Persist the session
persistSession(state);
// Reload the page under some conditions
maybeReload(oldState, state, action);
}