aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-02-15 07:54:35 -0800
committerAnton Tananaev <anton@traccar.org>2023-02-15 07:54:35 -0800
commit4029ec907beb45cefe7d194aac6c983c9dea7d50 (patch)
treee6cb2c7964d6a7d22a30a2eb7db5b2a520268438
parenta0d1387ce7055757abd731581cc0cce632608849 (diff)
downloadtrackermap-web-4029ec907beb45cefe7d194aac6c983c9dea7d50.tar.gz
trackermap-web-4029ec907beb45cefe7d194aac6c983c9dea7d50.tar.bz2
trackermap-web-4029ec907beb45cefe7d194aac6c983c9dea7d50.zip
Fix reports button
-rw-r--r--modern/src/reports/components/ReportFilter.js4
-rw-r--r--modern/src/store/reports.js4
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;
- },
},
});