Skip to content

Commit b31cd04

Browse files
committed
Show RT badge only for networks with vehicle positions data
The RT badge in network search results now checks for the 'vehicle_positions' feature in GTFS-RT resources instead of showing it for any GTFS-RT resource (which could be trip_updates or service_alerts only). https://claude.ai/code/session_013WRaHsC5Q55dP7zh4cjPLV
1 parent a684bee commit b31cd04

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/components/NetworkSearch.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interface Dataset {
66
id: string;
77
title: string;
88
type: string;
9-
resources: { format: string; original_url: string; url: string }[];
9+
resources: { format: string; original_url: string; url: string; features?: string[] }[];
1010
offers: { nom_commercial?: string; nom_aom?: string }[];
1111
covered_area: { nom?: string }[];
1212
}
@@ -239,7 +239,9 @@ export default function NetworkSearch({ onSelect, mode, currentTitle, onChangeNe
239239
filtered.map((dataset, idx) => {
240240
const area = dataset.covered_area?.[0]?.nom;
241241
const hasRt = dataset.resources.some(
242-
(r) => r.format.toLowerCase() === 'gtfs-rt',
242+
(r) =>
243+
r.format.toLowerCase() === 'gtfs-rt' &&
244+
r.features?.includes('vehicle_positions'),
243245
);
244246
return (
245247
<li

0 commit comments

Comments
 (0)