Skip to content

Commit

Permalink
fixed the user location icon issue
Browse files Browse the repository at this point in the history
  • Loading branch information
tarunsinghofficial committed Aug 1, 2024
1 parent 3047995 commit 1e91aff
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/oba/TripDetailsPane.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
}
const response = await fetch(url);
if (!response) {
if (!response.ok) {
error = 'Unable to fetch trip details';
return;
}
Expand All @@ -68,10 +68,15 @@
if (tripDetails.status?.closestStop) {
currentStopIndex = tripDetails.schedule.stopTimes.findIndex(
(stop) => stop.stopId === tripDetails.status.closestStop.stopId
(stop) => stop.stopId === tripDetails.status.closestStop
);
} else {
currentStopIndex = -1;
}
console.log('Current Stop Index:', currentStopIndex);
console.log('Closest Stop:', tripDetails.status?.closestStop);
calculateBusPosition();
} catch (err) {
console.error('Error fetching trip details:', err);
Expand Down

0 comments on commit 1e91aff

Please sign in to comment.