diff --git a/lib/reducers/keyserver-reducer.js b/lib/reducers/keyserver-reducer.js --- a/lib/reducers/keyserver-reducer.js +++ b/lib/reducers/keyserver-reducer.js @@ -111,24 +111,25 @@ } return state; } + const operations: ReplaceKeyserverOperation[] = []; if (sessionChange.cookie !== undefined) { - state = { - ...state, - keyserverInfos: { - ...state.keyserverInfos, - [keyserverID]: { + operations.push({ + type: 'replace_keyserver', + payload: { + id: keyserverID, + keyserverInfo: { ...state.keyserverInfos[keyserverID], cookie: sessionChange.cookie, }, }, - }; + }); } if (sessionChange.cookieInvalidated) { - state = { - ...state, - keyserverInfos: { - ...state.keyserverInfos, - [keyserverID]: { + operations.push({ + type: 'replace_keyserver', + payload: { + id: keyserverID, + keyserverInfo: { ...state.keyserverInfos[keyserverID], connection: { ...state.keyserverInfos[keyserverID].connection, @@ -136,9 +137,12 @@ }, }, }, - }; + }); } - return state; + return { + ...state, + keyserverInfos: processStoreOps(state.keyserverInfos, operations), + }; } else if ( action.type === logInActionTypes.success || action.type === siweAuthActionTypes.success ||