Skip to content

Commit

Permalink
Merge pull request #3746 from TrainLCD/fix/route-search-perf
Browse files Browse the repository at this point in the history
経路検索データから種別をとる
  • Loading branch information
TinyKitten authored Sep 12, 2024
2 parents 382eb9a + cf95be3 commit 6163faa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'fast-text-encoding'
require('fast-text-encoding')

import * as TaskManager from 'expo-task-manager'

Expand Down
9 changes: 8 additions & 1 deletion src/screens/RouteSearchScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,14 @@ const RouteSearchScreen = () => {
lineGroupId: trainType.groupId,
})

setNavigationState((prev) => ({ ...prev, trainType }))
const station = data.stations.find(
(s) => s.groupId === currentStation?.groupId
)

setNavigationState((prev) => ({
...prev,
trainType: station?.trainType ?? null,
}))
setStationState((prev) => ({ ...prev, stations: data.stations }))
navigation.navigate('SelectBound')
},
Expand Down

0 comments on commit 6163faa

Please sign in to comment.