diff --git a/lib/reducers/user-reducer.js b/lib/reducers/user-reducer.js --- a/lib/reducers/user-reducer.js +++ b/lib/reducers/user-reducer.js @@ -10,6 +10,8 @@ newThreadActionTypes, } from '../actions/thread-actions.js'; import { + identityLogInActionTypes, + identityRegisterActionTypes, deleteAccountActionTypes, keyserverAuthActionTypes, logOutActionTypes, @@ -55,6 +57,17 @@ action: BaseAction, ): ?CurrentUserInfo { if ( + action.type === identityLogInActionTypes.success || + action.type === identityRegisterActionTypes.success + ) { + const newUserInfo = { + id: action.payload.userID, + username: action.payload.username, + }; + if (!_isEqual(newUserInfo)(state)) { + return newUserInfo; + } + } else if ( action.type === logInActionTypes.success || action.type === siweAuthActionTypes.success || action.type === keyserverRegisterActionTypes.success ||