Skip to content

Commit

Permalink
Merge pull request #295 from hasadna/fix-change-line
Browse files Browse the repository at this point in the history
fix: useVehicleLocation cache mechanism
  • Loading branch information
giladfuchs authored Dec 13, 2023
2 parents 146b281 + 2bbd705 commit bd902de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/useVehicleLocations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function getLocations({
operatorRef?: number
onUpdate: (locations: VehicleLocation[] | { finished: true }) => void // the observer will be called every time with all the locations that were loaded
}) {
const key = `${formatTime(from)}-${formatTime(to)}`
const key = `${formatTime(from)}-${formatTime(to)}-${operatorRef}-${lineRef}`
if (!loadedLocations.has(key)) {
loadedLocations.set(key, new LocationObservable({ from, to, lineRef, operatorRef }))
}
Expand Down

0 comments on commit bd902de

Please sign in to comment.