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

bundle-emoji
Alex Gleason 2021-03-30 00:35:27 -05:00
rodzic 09cbcf6145
commit 15d61a98e7
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 5 dodań i 3 usunięć

Wyświetl plik

@ -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);
}