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 @@ -288,11 +288,11 @@ }; } else if (action.type === updateConnectionStatusActionType) { const { keyserverID, status } = action.payload; - return { - ...state, - keyserverInfos: { - ...state.keyserverInfos, - [keyserverID]: { + const operation: ReplaceKeyserverOperation = { + type: 'replace_keyserver', + payload: { + id: keyserverID, + keyserverInfo: { ...state.keyserverInfos[keyserverID], connection: { ...state.keyserverInfos[keyserverID].connection, @@ -302,13 +302,17 @@ }, }, }; - } else if (action.type === unsupervisedBackgroundActionType) { - const { keyserverID } = action.payload; return { ...state, - keyserverInfos: { - ...state.keyserverInfos, - [keyserverID]: { + keyserverInfos: processStoreOps(state.keyserverInfos, [operation]), + }; + } else if (action.type === unsupervisedBackgroundActionType) { + const { keyserverID } = action.payload; + const operation: ReplaceKeyserverOperation = { + type: 'replace_keyserver', + payload: { + id: keyserverID, + keyserverInfo: { ...state.keyserverInfos[keyserverID], connection: { ...state.keyserverInfos[keyserverID].connection, @@ -318,6 +322,10 @@ }, }, }; + return { + ...state, + keyserverInfos: processStoreOps(state.keyserverInfos, [operation]), + }; } else if (action.type === queueActivityUpdatesActionType) { const { activityUpdates, keyserverID } = action.payload; const oldConnection = state.keyserverInfos[keyserverID].connection;