@@ -4,6 +4,7 @@ import { StartSyncCurrentLocation, StartWatchCurrentLocation } from '@/actions/A
44import LocationError from '@/map/location_error.svg'
55import LocationSearching from '@/map/location_searching.svg'
66import LocationOn from '@/map/location_on.svg'
7+ import Location from '@/map/location.svg'
78import LocationNotInSync from '@/map/location_not_in_sync.svg'
89import { useEffect , useState } from 'react'
910import { CurrentLocationStoreState } from '@/stores/CurrentLocationStore'
@@ -15,8 +16,10 @@ export default function LocationButton(props: { currentLocation: CurrentLocation
1516 if ( props . currentLocation . enabled ) {
1617 if ( ! props . currentLocation . syncView ) setLocationSearch ( 'on_but_not_in_sync' )
1718 else if ( props . currentLocation . error ) setLocationSearch ( 'error' )
18- else if ( props . currentLocation . coordinate != null ) setLocationSearch ( 'initial ' )
19+ else if ( props . currentLocation . coordinate != null ) setLocationSearch ( 'on ' )
1920 else setLocationSearch ( 'search' )
21+ } else {
22+ setLocationSearch ( 'initial' )
2023 }
2124 } , [
2225 props . currentLocation . syncView ,
@@ -37,9 +40,10 @@ export default function LocationButton(props: { currentLocation: CurrentLocation
3740 }
3841 } }
3942 >
43+ { locationSearch == 'initial' && < Location /> }
4044 { locationSearch == 'error' && < LocationError /> }
4145 { locationSearch == 'search' && < LocationSearching /> }
42- { locationSearch == 'initial ' && < LocationOn /> }
46+ { locationSearch == 'on ' && < LocationOn /> }
4347 { locationSearch == 'on_but_not_in_sync' && < LocationNotInSync /> }
4448 </ div >
4549 )
0 commit comments