aboutsummaryrefslogtreecommitdiff
path: root/modern/src/settings/AccumulatorsPage.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-05-23 06:44:15 -0700
committerAnton Tananaev <anton@traccar.org>2022-05-23 06:44:15 -0700
commitddcb42512e95e98806db0523e4d954484a6e48cc (patch)
tree795fbd841eb94ded02ce66a2a2c50c2cc52a7dcd /modern/src/settings/AccumulatorsPage.js
parentfdbc6762b10233950d9c84fc71a9a8c11823f0a9 (diff)
downloadtrackermap-web-ddcb42512e95e98806db0523e4d954484a6e48cc.tar.gz
trackermap-web-ddcb42512e95e98806db0523e4d954484a6e48cc.tar.bz2
trackermap-web-ddcb42512e95e98806db0523e4d954484a6e48cc.zip
Upgrade router and navigation
Diffstat (limited to 'modern/src/settings/AccumulatorsPage.js')
-rw-r--r--modern/src/settings/AccumulatorsPage.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/modern/src/settings/AccumulatorsPage.js b/modern/src/settings/AccumulatorsPage.js
index b22fe02e..8ca9d277 100644
--- a/modern/src/settings/AccumulatorsPage.js
+++ b/modern/src/settings/AccumulatorsPage.js
@@ -1,6 +1,6 @@
import React, { useEffect, useState } from 'react';
import { useSelector } from 'react-redux';
-import { useHistory, useParams } from 'react-router-dom';
+import { useNavigate, useParams } from 'react-router-dom';
import {
Accordion, AccordionSummary, AccordionDetails, makeStyles, Typography, Container, TextField, FormControl, Button,
} from '@material-ui/core';
@@ -27,7 +27,7 @@ const useStyles = makeStyles((theme) => ({
}));
const AccumulatorsPage = () => {
- const history = useHistory();
+ const navigate = useNavigate();
const classes = useStyles();
const t = useTranslation();
@@ -54,7 +54,7 @@ const AccumulatorsPage = () => {
});
if (response.ok) {
- history.goBack();
+ navigate(-1);
} else {
throw Error(await response.text());
}
@@ -95,7 +95,7 @@ const AccumulatorsPage = () => {
type="button"
color="primary"
variant="outlined"
- onClick={() => history.goBack()}
+ onClick={() => navigate(-1)}
>
{t('sharedCancel')}
</Button>