Skip to content

Commit

Permalink
fix: single line map page (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
NoamGaash authored Oct 15, 2023
1 parent fbdb6f0 commit 6868ee8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/api/gtfsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export async function getRoutesAsync(
const gtfsRoutes = await GTFS_API.gtfsRoutesListGet({
routeShortName: lineNumber,
operatorRefs: operatorId,
dateFrom: fromTimestamp.toDate(),
dateTo: toTimestamp.toDate(),
dateFrom: fromTimestamp.startOf('day').toDate(),
dateTo: moment.min(toTimestamp.endOf('day'), moment()).toDate(),
limit: 100,
})
const routes = Object.values(
Expand Down
4 changes: 2 additions & 2 deletions src/api/useVehicleLocations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export default function useVehicleLocations({
const [locations, setLocations] = useState<VehicleLocation[]>([])
const [isLoading, setIsLoading] = useState<boolean[]>([])
useEffect(() => {
const range = split ? getMinutesInRange(from, to) : [{ from, to }]
const range = split ? getMinutesInRange(from, to, split) : [{ from, to }]
setIsLoading(range.map(() => true))
const unmounts = range.map(({ from, to }, i) =>
getLocations({
Expand Down Expand Up @@ -180,7 +180,7 @@ export default function useVehicleLocations({
unmounts.forEach((unmount) => unmount())
setIsLoading([])
}
}, [from, to])
}, [from, to, lineRef, split])
return {
locations,
isLoading: isLoading.some((loading) => loading),
Expand Down

0 comments on commit 6868ee8

Please sign in to comment.