Changeset View
Changeset View
Standalone View
Standalone View
lib/reducers/report-store-reducer.js
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | ): { | ||||
) { | ) { | ||||
return { | return { | ||||
reportStore: { | reportStore: { | ||||
queuedReports: [], | queuedReports: [], | ||||
enabledReports: isDev | enabledReports: isDev | ||||
? defaultDevEnabledReports | ? defaultDevEnabledReports | ||||
: defaultEnabledReports, | : defaultEnabledReports, | ||||
}, | }, | ||||
reportStoreOperations: [], | reportStoreOperations: [{ type: 'remove_all_reports' }], | ||||
}; | }; | ||||
} else if ( | } else if ( | ||||
action.type === logInActionTypes.success || | action.type === logInActionTypes.success || | ||||
action.type === siweAuthActionTypes.success | action.type === siweAuthActionTypes.success | ||||
) { | ) { | ||||
return { | return { | ||||
reportStore: { | reportStore: { | ||||
queuedReports: [], | queuedReports: [], | ||||
enabledReports: | enabledReports: | ||||
isStaff(action.payload.currentUserInfo.id) || isDev | isStaff(action.payload.currentUserInfo.id) || isDev | ||||
? defaultDevEnabledReports | ? defaultDevEnabledReports | ||||
: defaultEnabledReports, | : defaultEnabledReports, | ||||
}, | }, | ||||
reportStoreOperations: [], | reportStoreOperations: [{ type: 'remove_all_reports' }], | ||||
}; | }; | ||||
} else if ( | } else if ( | ||||
(action.type === sendReportActionTypes.success || | (action.type === sendReportActionTypes.success || | ||||
action.type === sendReportsActionTypes.success) && | action.type === sendReportsActionTypes.success) && | ||||
action.payload | action.payload | ||||
) { | ) { | ||||
const { payload } = action; | const { payload } = action; | ||||
const unsentReports = updatedReports.filter( | const unsentReports = updatedReports.filter( | ||||
Show All 29 Lines |