小整理

This commit is contained in:
harukin-expo-dev-env 2025-08-12 16:51:42 +00:00
parent d412941635
commit 367a70170f

View File

@ -53,10 +53,9 @@ export const TrainPosition: FC<Props> = ({
) )
.then((res) => res.json()) .then((res) => res.json())
.then((data: { type: string; platform: number; description: string }) => { .then((data: { type: string; platform: number; description: string }) => {
setPlatformNumber(data?.type == "Station" ? data?.platform : undefined); const { type, platform, description } = data;
setPlatformDescription( setPlatformNumber(type == "Station" ? platform : undefined);
data?.type == "Station" ? data?.description : undefined setPlatformDescription(type == "Station" ? description : undefined);
);
}); });
}, [currentTrainData, currentTrain]); }, [currentTrainData, currentTrain]);