diff --git a/components/発車時刻表/LED_inside_Component/TrainPosition.tsx b/components/発車時刻表/LED_inside_Component/TrainPosition.tsx index c6243b4..7e41950 100644 --- a/components/発車時刻表/LED_inside_Component/TrainPosition.tsx +++ b/components/発車時刻表/LED_inside_Component/TrainPosition.tsx @@ -53,10 +53,9 @@ export const TrainPosition: FC = ({ ) .then((res) => res.json()) .then((data: { type: string; platform: number; description: string }) => { - setPlatformNumber(data?.type == "Station" ? data?.platform : undefined); - setPlatformDescription( - data?.type == "Station" ? data?.description : undefined - ); + const { type, platform, description } = data; + setPlatformNumber(type == "Station" ? platform : undefined); + setPlatformDescription(type == "Station" ? description : undefined); }); }, [currentTrainData, currentTrain]);