Page MenuHomePhabricator

D11692.id39415.diff
No OneTemporary

D11692.id39415.diff

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?.id) {
+ 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 &&

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 4:04 AM (16 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2566340
Default Alt Text
D11692.id39415.diff (1 KB)

Event Timeline