小整理

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((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]);