Skip to content

Commit

Permalink
Merge pull request #3561 from TrainLCD/fix/local-type
Browse files Browse the repository at this point in the history
普通/各駅停車が選べないバグを修正
  • Loading branch information
TinyKitten authored Jul 14, 2024
2 parents 3865f9a + 1597993 commit abe7a51
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/screens/TrainTypeSettingsScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,9 @@ const TrainTypeSettings: React.FC = () => {
)

const onPressBack = useCallback(async () => {
if (!trainType) {
return
if (trainType) {
await fetchTrainTypeStations({ lineGroupId: trainType.groupId })
}
await fetchTrainTypeStations({ lineGroupId: trainType.groupId })

if (navigation.canGoBack()) {
navigation.goBack()
Expand All @@ -71,9 +70,10 @@ const TrainTypeSettings: React.FC = () => {
...prev,
trainType: null,
}))
// 種別が変わるとすでに選択していた行先が停車駅に存在しない場合があるのでリセットする
setStationState((prev) => ({
...prev,
stations: [],
wantedDestination: null,
}))
return
}
Expand Down

0 comments on commit abe7a51

Please sign in to comment.