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 @@ -64,24 +64,6 @@ if (!_isEqual(newUserInfo)(state)) { return newUserInfo; } - } else if (action.type === keyserverAuthActionTypes.success) { - const { currentUserInfo: actionUserInfo } = action.payload; - if (actionUserInfo) { - if (!state?.id || actionUserInfo.id !== state.id) { - console.log( - 'keyserver auth returned a different user info than identity login', - ); - } else { - const newUserInfo = { - ...state, - avatar: actionUserInfo.avatar, - settings: actionUserInfo.settings, - }; - if (!_isEqual(newUserInfo)(state)) { - return newUserInfo; - } - } - } } else if ( action.type === logInActionTypes.success || action.type === siweAuthActionTypes.success || @@ -98,9 +80,22 @@ action.payload.keyserverID === authoritativeKeyserverID() && relyingOnAuthoritativeKeyserver ) { - const { sessionChange } = action.payload; - if (!_isEqual(sessionChange.currentUserInfo)(state)) { - return sessionChange.currentUserInfo; + const actionUserInfo = action.payload.sessionChange.currentUserInfo; + if (!actionUserInfo) { + return actionUserInfo; + } else if (!state?.id || actionUserInfo.id !== state.id) { + console.log( + 'keyserver auth returned a different user info than identity login', + ); + } else { + const newUserInfo = { + ...state, + avatar: actionUserInfo.avatar, + settings: actionUserInfo.settings, + }; + if (!_isEqual(newUserInfo)(state)) { + return newUserInfo; + } } } else if ( action.type === fullStateSyncActionType &&