From 4029ec907beb45cefe7d194aac6c983c9dea7d50 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 15 Feb 2023 07:54:35 -0800 Subject: Fix reports button --- modern/src/reports/components/ReportFilter.js | 4 ++-- modern/src/store/reports.js | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/modern/src/reports/components/ReportFilter.js b/modern/src/reports/components/ReportFilter.js index de692613..ff0dc146 100644 --- a/modern/src/reports/components/ReportFilter.js +++ b/modern/src/reports/components/ReportFilter.js @@ -27,7 +27,7 @@ const ReportFilter = ({ children, handleSubmit, handleSchedule, showOnly, ignore const period = useSelector((state) => state.reports.period); const from = useSelector((state) => state.reports.from); const to = useSelector((state) => state.reports.to); - const button = useSelector((state) => state.reports.button); + const [button, setButton] = useState('json'); const [description, setDescription] = useState(); const [calendarId, setCalendarId] = useState(); @@ -204,7 +204,7 @@ const ReportFilter = ({ children, handleSubmit, handleSchedule, showOnly, ignore disabled={disabled} onClick={handleClick} selected={button} - setSelected={(value) => dispatch(reportsActions.updateButton(value))} + setSelected={(value) => setButton(value)} options={readonly ? { json: t('reportShow'), export: t('reportExport'), diff --git a/modern/src/store/reports.js b/modern/src/store/reports.js index 870a0420..9834c8b8 100644 --- a/modern/src/store/reports.js +++ b/modern/src/store/reports.js @@ -8,7 +8,6 @@ const { reducer, actions } = createSlice({ period: 'today', from: moment().subtract(1, 'hour').locale('en').format(moment.HTML5_FMT.DATETIME_LOCAL), to: moment().locale('en').format(moment.HTML5_FMT.DATETIME_LOCAL), - button: 'json', }, reducers: { updateGroupIds(state, action) { @@ -23,9 +22,6 @@ const { reducer, actions } = createSlice({ updateTo(state, action) { state.to = action.payload; }, - updateButton(state, action) { - state.button = action.payload; - }, }, }); -- cgit v1.2.3