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/overlay/MapOverlay.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/overlay/MapOverlay.js')
-rw-r--r-- | modern/src/map/overlay/MapOverlay.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modern/src/map/overlay/MapOverlay.js b/modern/src/map/overlay/MapOverlay.js index 85797d4b..4db2153d 100644 --- a/modern/src/map/overlay/MapOverlay.js +++ b/modern/src/map/overlay/MapOverlay.js @@ -1,5 +1,5 @@ import { useId, useEffect } from 'react'; -import usePersistedState from '../../common/util/usePersistedState'; +import { useAttributePreference } from '../../common/util/preferences'; import { map } from '../core/MapView'; import useMapOverlays from './useMapOverlays'; @@ -7,7 +7,7 @@ const MapOverlay = () => { const id = useId(); const mapOverlays = useMapOverlays(); - const [selectedMapOverlay] = usePersistedState('selectedMapOverlay'); + const selectedMapOverlay = useAttributePreference('selectedMapOverlay'); const activeOverlay = mapOverlays.filter((overlay) => overlay.available).find((overlay) => overlay.id === selectedMapOverlay); |