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 @@ -4,7 +4,10 @@ import { reduceDeviceToken } from './device-token-reducer.js'; import reduceLastCommunicatedPlatformDetails from './last-communicated-platform-details-reducer.js'; import reduceUpdatesCurrentAsOf from './updates-reducer.js'; -import { addKeyserverActionType } from '../actions/keyserver-actions.js'; +import { + addKeyserverActionType, + removeKeyserverActionType, +} from '../actions/keyserver-actions.js'; import { siweAuthActionTypes } from '../actions/siwe-actions.js'; import { logInActionTypes, @@ -48,6 +51,14 @@ }, }, }; + } else if (action.type === removeKeyserverActionType) { + const { [action.payload.keyserverAdminUserID]: _, ...rest } = + state.keyserverInfos; + + return { + ...state, + keyserverInfos: rest, + }; } else if (action.type === resetUserStateActionType) { // this action is only dispatched on native const stateCookie = state.keyserverInfos[ashoatKeyserverID]?.cookie;