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 @@ -43,13 +43,6 @@ isReportEnabled(report, state.enabledReports), ); - const updatedReports = - newInconsistencies.length > 0 - ? [...state.queuedReports, ...newInconsistencies].filter(report => - isReportEnabled(report, state.enabledReports), - ) - : state.queuedReports; - if (action.type === updateReportsEnabledActionType) { const newEnabledReports = { ...state.enabledReports, ...action.payload }; const newFilteredReports = newReports.filter(report => @@ -151,10 +144,24 @@ reportStoreOperations, }; } - const reportStore = - updatedReports !== state.queuedReports - ? { ...state, queuedReports: updatedReports } - : state; - return { reportStore, reportStoreOperations: [] }; + if (newReports) { + const reportStoreOperations: $ReadOnlyArray = + convertReportsToReplaceReportOps(newReports); + + const queuedReports = processReportStoreOperations( + state.queuedReports, + reportStoreOperations, + ); + + return { + reportStore: { + ...state, + queuedReports, + }, + reportStoreOperations, + }; + } + + return { reportStore: state, reportStoreOperations: [] }; }