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 @@ -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'; @@ -73,12 +74,7 @@ }, reportStoreOperations, }; - } else if ( - action.type === logOutActionTypes.success || - action.type === deleteKeyserverAccountActionTypes.success || - (action.type === setNewSessionActionType && - action.payload.sessionChange.cookieInvalidated) - ) { + } else if (action.type === logOutActionTypes.success) { return { reportStore: { queuedReports: [], @@ -88,6 +84,22 @@ }, reportStoreOperations: [{ type: 'remove_all_reports' }], }; + } else if ( + action.type === deleteKeyserverAccountActionTypes.success || + (action.type === setNewSessionActionType && + action.payload.sessionChange.cookieInvalidated) + ) { + if (!usingCommServicesAccessToken) { + return { + reportStore: { + queuedReports: [], + enabledReports: isDev + ? defaultDevEnabledReports + : defaultEnabledReports, + }, + reportStoreOperations: [{ type: 'remove_all_reports' }], + }; + } } else if ( action.type === logInActionTypes.success || action.type === siweAuthActionTypes.success