小整理
This commit is contained in:
parent
d412941635
commit
367a70170f
@ -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]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user