diff options
author | Boubrid Ihab <boubrid.ihab@gmail.com> | 2022-05-23 17:15:39 +0100 |
---|---|---|
committer | Boubrid Ihab <boubrid.ihab@gmail.com> | 2022-05-23 17:15:39 +0100 |
commit | 0b9209f877c42d9eb69d4b94cfa9c7f16a81967e (patch) | |
tree | 72286ee879bea52fa2dad73f36d1e2b36a35bc15 /modern/src/SocketController.js | |
parent | c30e57579868b8f3d21e6e6083e37cba8bcfa408 (diff) | |
parent | 0ed610e71b28461d6c9cc996764b00db5ac0b2ba (diff) | |
download | trackermap-web-0b9209f877c42d9eb69d4b94cfa9c7f16a81967e.tar.gz trackermap-web-0b9209f877c42d9eb69d4b94cfa9c7f16a81967e.tar.bz2 trackermap-web-0b9209f877c42d9eb69d4b94cfa9c7f16a81967e.zip |
Merge branch 'master' of github.com:traccar/traccar-web into fix-key-issue
Diffstat (limited to 'modern/src/SocketController.js')
-rw-r--r-- | modern/src/SocketController.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modern/src/SocketController.js b/modern/src/SocketController.js index 9826d4b1..57ffa0d5 100644 --- a/modern/src/SocketController.js +++ b/modern/src/SocketController.js @@ -1,7 +1,7 @@ import React, { useEffect, useRef, useState } from 'react'; import { useDispatch, useSelector, connect } from 'react-redux'; -import { Snackbar } from '@material-ui/core'; -import { useHistory } from 'react-router-dom'; +import { Snackbar } from '@mui/material'; +import { useNavigate } from 'react-router-dom'; import { positionsActions, devicesActions, sessionActions } from './store'; import { useEffectAsync } from './reactHelper'; @@ -11,7 +11,7 @@ import { snackBarDurationLongMs } from './common/util/duration'; const SocketController = () => { const dispatch = useDispatch(); - const history = useHistory(); + const navigate = useNavigate(); const t = useTranslation(); const authenticated = useSelector((state) => !!state.session.user); @@ -74,7 +74,7 @@ const SocketController = () => { if (response.ok) { dispatch(sessionActions.updateUser(await response.json())); } else { - history.push('/login'); + navigate('/login'); } return null; }, [authenticated]); |