Skip to content

Commit

Permalink
Merge branch 'main' into deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
davwheat committed Jul 15, 2024
2 parents 7e96c4e + 6fb92dd commit 8a59a47
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/upload_audio_to_r2.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Smoketest
name: Upload to R2

on:
push:
Expand Down
24 changes: 10 additions & 14 deletions src/components/AmeyLiveTrainAnnouncements.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ export function LiveTrainAnnouncements<SystemKeys extends string>({
value: r.crsCode,
label: r.name,
}
}),
}).concat(system.ADDITIONAL_STATIONS.map(s => ({ value: s.value, label: s.title }))),
] as [string, Option[]]
}),
),
Expand All @@ -469,20 +469,16 @@ export function LiveTrainAnnouncements<SystemKeys extends string>({
// Ignore duplicates
const allSupportedStations = useMemo(
() =>
Array.from(
new Set(
Object.values(perSystemSupportedStations)
.concat(
Object.values<AmeyPhil>(systems)
.map(s => s.ADDITIONAL_STATIONS)
.flat()
.filter(o => o.value.length === 3)
.map(o => ({ value: o.value, label: o.title })),
)
Object.values(perSystemSupportedStations)
.concat(
Object.values<AmeyPhil>(systems)
.map(s => s.ADDITIONAL_STATIONS)
.flat()
.map(s => s.value),
),
),
.filter(o => o.value.length === 3)
.map(o => ({ value: o.value, label: o.title })),
)
.flat()
.filter((s, i, arr) => arr.findIndex(s2 => s2.value === s.value) === i),
[perSystemSupportedStations],
)

Expand Down

0 comments on commit 8a59a47

Please sign in to comment.