diff --git a/src/components/ImportStateFromRtt.tsx b/src/components/ImportStateFromRtt.tsx index 9b2ff726b..f42b54f40 100644 --- a/src/components/ImportStateFromRtt.tsx +++ b/src/components/ImportStateFromRtt.tsx @@ -255,6 +255,11 @@ export default function ImportStateFromRtt({ importStateFromRttService, disabled required value={rttUri} onChange={e => setRttUri(e.target.value)} + onKeyDown={e => { + if (e.key === 'Enter') { + importService() + } + }} /> )} diff --git a/src/data/RttUtils.ts b/src/data/RttUtils.ts index fee2c4b50..453c048ca 100644 --- a/src/data/RttUtils.ts +++ b/src/data/RttUtils.ts @@ -33,12 +33,14 @@ export class RttUtils { if (i === arr.length - 1 && l.destination.some(d => d.tiploc === l.tiploc)) return false return true }) - .map(l => ({ - ...stationItemCompleter(l.crs!), - rttPlatform: l.platform ?? null, - arrLateness: l.realtimeGbttArrivalLateness ?? null, - depLateness: l.realtimeGbttDepartureLateness ?? null, - })) + .map(l => { + return { + ...stationItemCompleter(l.crs!), + rttPlatform: l.platform ?? null, + arrLateness: l.realtimeGbttArrivalLateness ?? null, + depLateness: l.realtimeGbttDepartureLateness ?? null, + } + }) } static getEligibleLocations(rttService: RttResponse): CallingAtPointWithRttDetail[] {