Skip to content

Commit

Permalink
Set refresh to nearby page
Browse files Browse the repository at this point in the history
  • Loading branch information
chunlaw committed May 12, 2024
1 parent b5824bf commit 92849cf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/home/lists/NearbyRouteList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,18 @@ const NearbyRouteList = ({ isFocus }: NearbyRouteListProps) => {
() =>
throttle((geolocation: Location) => {
setState(geolocation);
}, 1000),
}, 500),
[]
);

useEffect(() => {
const interval = setInterval(() => {
throttleUpdateGeolocation(manualGeolocation ?? geolocation.current);
}, 1000);
throttleUpdateGeolocation(manualGeolocation ?? geolocation.current);
return () => {
clearInterval(interval);
};
}, [manualGeolocation, geolocation, throttleUpdateGeolocation]);

const routes = useMemo(
Expand Down

0 comments on commit 92849cf

Please sign in to comment.