diff options
author | Anton Tananaev <anton@traccar.org> | 2022-10-28 13:28:28 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-10-28 13:28:28 -0700 |
commit | fac80024e0956d543b762296e0ee49cd72035b93 (patch) | |
tree | 41074dddc57d0c4fdb1b7162b1c3d74633e4ea31 /modern/src/map/main/MapSelectedDevice.js | |
parent | ef315b8e10329db80da1a97e96b3cc82481370ae (diff) | |
download | trackermap-web-fac80024e0956d543b762296e0ee49cd72035b93.tar.gz trackermap-web-fac80024e0956d543b762296e0ee49cd72035b93.tar.bz2 trackermap-web-fac80024e0956d543b762296e0ee49cd72035b93.zip |
Persist user preferences
Diffstat (limited to 'modern/src/map/main/MapSelectedDevice.js')
-rw-r--r-- | modern/src/map/main/MapSelectedDevice.js | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/modern/src/map/main/MapSelectedDevice.js b/modern/src/map/main/MapSelectedDevice.js index c52b8df0..3f444409 100644 --- a/modern/src/map/main/MapSelectedDevice.js +++ b/modern/src/map/main/MapSelectedDevice.js @@ -4,7 +4,6 @@ import { useSelector } from 'react-redux'; import dimensions from '../../common/theme/dimensions'; import { map } from '../core/MapView'; import { usePrevious } from '../../reactHelper'; -import usePersistedState from '../../common/util/usePersistedState'; import { useAttributePreference } from '../../common/util/preferences'; const MapSelectedDevice = () => { @@ -12,11 +11,10 @@ const MapSelectedDevice = () => { const previousDeviceId = usePrevious(selectedDeviceId); const selectZoom = useAttributePreference('web.selectZoom', 10); + const mapFollow = useAttributePreference('mapFollow', false); const position = useSelector((state) => state.positions.items[selectedDeviceId]); - const [mapFollow] = usePersistedState('mapFollow', false); - useEffect(() => { if ((selectedDeviceId !== previousDeviceId || mapFollow) && position) { map.easeTo({ |