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 @@ -27,6 +27,7 @@ updateConnectionStatusActionType, setLateResponseActionType, updateDisconnectedBarActionType, + setConnectionIssueActionType, } from '../types/socket-types.js'; import { updateTypes } from '../types/update-types-enum.js'; import { processUpdatesActionType } from '../types/update-types.js'; @@ -364,6 +365,21 @@ ...state, keyserverInfos, }; + } else if (action.type === setConnectionIssueActionType) { + const { connectionIssue, keyserverID } = action.payload; + return { + ...state, + keyserverInfos: { + ...state.keyserverInfos, + [keyserverID]: { + ...state.keyserverInfos[keyserverID], + connection: { + ...state.keyserverInfos[keyserverID].connection, + connectionIssue, + }, + }, + }, + }; } return state; 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 @@ -98,6 +98,7 @@ } from './search-types.js'; import type { SetSessionPayload } from './session-types.js'; import type { + ConnectionIssue, StateSyncFullActionPayload, StateSyncIncrementalActionPayload, UpdateConnectionStatusPayload, @@ -1236,6 +1237,10 @@ | { +type: 'SET_CUSTOM_SERVER', +payload: string, + } + | { + +type: 'SET_CONNECTION_ISSUE', + +payload: { +connectionIssue: ConnectionIssue, +keyserverID: string }, }; export type ActionPayload = ?(Object | Array<*> | $ReadOnlyArray<*> | string); diff --git a/lib/types/socket-types.js b/lib/types/socket-types.js --- a/lib/types/socket-types.js +++ b/lib/types/socket-types.js @@ -516,6 +516,9 @@ lateResponses: [], showDisconnectedBar: false, }; + +export const setConnectionIssueActionType = 'SET_CONNECTION_ISSUE'; + export const updateConnectionStatusActionType = 'UPDATE_CONNECTION_STATUS'; export type UpdateConnectionStatusPayload = { +status: ConnectionStatus,