diff --git a/lib/keyserver-conn/keyserver-conn-types.js b/lib/keyserver-conn/keyserver-conn-types.js --- a/lib/keyserver-conn/keyserver-conn-types.js +++ b/lib/keyserver-conn/keyserver-conn-types.js @@ -93,4 +93,7 @@ +keyserverID: string, }; +export const setSessionRecoveryInProgressActionType = + 'SET_SESSION_RECOVERY_IN_PROGRESS'; + export { setNewSessionActionType, setNewSession }; 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 @@ -26,6 +26,7 @@ setLateResponseActionType, updateKeyserverReachabilityActionType, setConnectionIssueActionType, + setSessionRecoveryInProgressActionType, } from '../keyserver-conn/keyserver-conn-types.js'; import { keyserverStoreOpsHandlers, @@ -619,6 +620,28 @@ }, keyserverStoreOperations: [operation], }; + } else if (action.type === setSessionRecoveryInProgressActionType) { + const { sessionRecoveryInProgress, keyserverID } = action.payload; + const operation: ReplaceKeyserverOperation = { + type: 'replace_keyserver', + payload: { + id: keyserverID, + keyserverInfo: { + ...state.keyserverInfos[keyserverID], + connection: { + ...state.keyserverInfos[keyserverID].connection, + sessionRecoveryInProgress, + }, + }, + }, + }; + return { + keyserverStore: { + ...state, + keyserverInfos: processStoreOps(state.keyserverInfos, [operation]), + }, + keyserverStoreOperations: [operation], + }; } return { diff --git a/lib/types/redux-types.js b/lib/types/redux-types.js --- a/lib/types/redux-types.js +++ b/lib/types/redux-types.js @@ -1339,6 +1339,10 @@ | { +type: 'SET_CONNECTION_ISSUE', +payload: { +connectionIssue: ?ConnectionIssue, +keyserverID: string }, + } + | { + +type: 'SET_SESSION_RECOVERY_IN_PROGRESS', + +payload: { +sessionRecoveryInProgress: boolean, +keyserverID: string }, }; export type ActionPayload = ?(Object | Array<*> | $ReadOnlyArray<*> | string);