Skip to content

Commit

Permalink
普通/各駅停車が選べないバグを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
TinyKitten committed Jul 14, 2024
1 parent 3865f9a commit 1597993
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 1597993

Please sign in to comment.