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