diff --git a/native/redux/redux-setup.js b/native/redux/redux-setup.js --- a/native/redux/redux-setup.js +++ b/native/redux/redux-setup.js @@ -383,24 +383,26 @@ } await Promise.all(promises); } catch { - dispatch({ - type: setNewSessionActionType, - payload: { - sessionChange: { - cookie: null, - cookieInvalidated: false, - currentUserInfo: state.currentUserInfo, - }, - preRequestUserState: { - currentUserInfo: state.currentUserInfo, - sessionID: undefined, - cookie: state.cookie, + if (state._persist?.rehydrated) { + dispatch({ + type: setNewSessionActionType, + payload: { + sessionChange: { + cookie: null, + cookieInvalidated: false, + currentUserInfo: state.currentUserInfo, + }, + preRequestUserState: { + currentUserInfo: state.currentUserInfo, + sessionID: undefined, + cookie: state.cookie, + }, + error: null, + logInActionSource: logInActionSources.sqliteOpFailure, }, - error: null, - logInActionSource: logInActionSources.sqliteOpFailure, - }, - }); - await persistor.flush(); + }); + await persistor.flush(); + } ExitApp.exitApp(); } })();