diff --git a/lib/reducers/report-store-reducer.js b/lib/reducers/report-store-reducer.js --- a/lib/reducers/report-store-reducer.js +++ b/lib/reducers/report-store-reducer.js @@ -9,7 +9,7 @@ import { siweAuthActionTypes } from '../actions/siwe-actions.js'; import { logOutActionTypes, - deleteKeyserverAccountActionTypes, + deleteAccountActionTypes, logInActionTypes, } from '../actions/user-actions.js'; import { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js'; @@ -29,6 +29,7 @@ } from '../types/report-types.js'; import { isDev } from '../utils/dev-utils.js'; import { isReportEnabled } from '../utils/report-utils.js'; +import { usingCommServicesAccessToken } from '../utils/services-utils.js'; export const updateReportsEnabledActionType = 'UPDATE_REPORTS_ENABLED'; @@ -75,9 +76,21 @@ }; } else if ( action.type === logOutActionTypes.success || - action.type === deleteKeyserverAccountActionTypes.success || - (action.type === setNewSessionActionType && - action.payload.sessionChange.cookieInvalidated) + action.type === deleteAccountActionTypes.success + ) { + return { + reportStore: { + queuedReports: [], + enabledReports: isDev + ? defaultDevEnabledReports + : defaultEnabledReports, + }, + reportStoreOperations: [{ type: 'remove_all_reports' }], + }; + } else if ( + action.type === setNewSessionActionType && + action.payload.sessionChange.cookieInvalidated && + !usingCommServicesAccessToken ) { return { reportStore: {