diff --git a/lib/reducers/calendar-filters-reducer.js b/lib/reducers/calendar-filters-reducer.js --- a/lib/reducers/calendar-filters-reducer.js +++ b/lib/reducers/calendar-filters-reducer.js @@ -18,6 +18,7 @@ logInActionTypes, tempIdentityLoginActionTypes, keyserverRegisterActionTypes, + deleteAccountActionTypes, } from '../actions/user-actions.js'; import { extractKeyserverIDFromID } from '../keyserver-conn/keyserver-call-utils.js'; import { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js'; @@ -56,7 +57,7 @@ if ( action.type === tempIdentityLoginActionTypes.success || action.type === logOutActionTypes.success || - action.type === deleteKeyserverAccountActionTypes.success || + action.type === deleteAccountActionTypes.success || action.type === logInActionTypes.success || action.type === siweAuthActionTypes.success || action.type === keyserverRegisterActionTypes.success || @@ -64,6 +65,11 @@ action.payload.sessionChange.cookieInvalidated) ) { return defaultCalendarFilters; + } else if (action.type === deleteKeyserverAccountActionTypes.success) { + return removeKeyserverThreadIDsFromFilterList( + state, + action.payload.keyserverIDs, + ); } else if (action.type === keyserverAuthActionTypes.success) { const keyserverIDs = Object.keys(action.payload.updatesCurrentAsOf); return removeKeyserverThreadIDsFromFilterList(state, keyserverIDs); diff --git a/lib/reducers/calendar-query-reducer.js b/lib/reducers/calendar-query-reducer.js --- a/lib/reducers/calendar-query-reducer.js +++ b/lib/reducers/calendar-query-reducer.js @@ -1,5 +1,6 @@ // @flow +import { removeKeyserverThreadIDsFromFilterList } from './calendar-filters-reducer.js'; import { updateCalendarQueryActionTypes } from '../actions/entry-actions.js'; import { siweAuthActionTypes } from '../actions/siwe-actions.js'; import { @@ -7,6 +8,7 @@ deleteKeyserverAccountActionTypes, logInActionTypes, keyserverRegisterActionTypes, + deleteAccountActionTypes, } from '../actions/user-actions.js'; import { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js'; import { defaultCalendarQuery } from '../types/entry-types.js'; @@ -24,11 +26,19 @@ ): CalendarQuery { if ( action.type === logOutActionTypes.success || - action.type === deleteKeyserverAccountActionTypes.success || + action.type === deleteAccountActionTypes.success || (action.type === setNewSessionActionType && action.payload.sessionChange.cookieInvalidated) ) { return defaultCalendarQuery(getConfig().platformDetails.platform); + } else if (action.type === deleteKeyserverAccountActionTypes.success) { + return { + ...state, + filters: removeKeyserverThreadIDsFromFilterList( + state.filters, + action.payload.keyserverIDs, + ), + }; } else if ( action.type === logInActionTypes.success || action.type === siweAuthActionTypes.success