Skip to content

Commit a5da003

Browse files
TinyKittenclaude
andauthored
路線選択時に前回の列車種別データが残るバグを修正 (#5352)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 71cd957 commit a5da003

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

src/screens/SelectLineScreen.tsx

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -562,18 +562,10 @@ const SelectLineScreen = () => {
562562

563563
setIsSelectBoundModalOpen(true);
564564

565-
const result = await fetchStationsByLineId({
566-
variables: { lineId, stationId: lineStationId },
567-
});
568-
const fetchedStations = result.data?.lineStations ?? [];
569-
570-
const pendingStation =
571-
fetchedStations.find((s) => s.id === lineStationId) ?? null;
572-
573565
setStationState((prev) => ({
574566
...prev,
575-
pendingStation,
576-
pendingStations: fetchedStations,
567+
pendingStation: null,
568+
pendingStations: [],
577569
selectedDirection: null,
578570
wantedDestination: null,
579571
selectedBound: null,
@@ -589,6 +581,20 @@ const SelectLineScreen = () => {
589581
pendingTrainType: null,
590582
}));
591583

584+
const result = await fetchStationsByLineId({
585+
variables: { lineId, stationId: lineStationId },
586+
});
587+
const fetchedStations = result.data?.lineStations ?? [];
588+
589+
const pendingStation =
590+
fetchedStations.find((s) => s.id === lineStationId) ?? null;
591+
592+
setStationState((prev) => ({
593+
...prev,
594+
pendingStation,
595+
pendingStations: fetchedStations,
596+
}));
597+
592598
if (line.station?.hasTrainTypes) {
593599
const result = await fetchTrainTypes({
594600
variables: {

0 commit comments

Comments
 (0)