Shorten code
This commit is contained in:
parent
bf8dea7bcd
commit
c2bc1ad1e5
@ -13,7 +13,7 @@
|
|||||||
fetchData();
|
fetchData();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (jsonData && jsonData.GetStationBoardResult && jsonData.GetStationBoardResult.trainServices && jsonData.GetStationBoardResult.trainServices.service) {
|
if (jsonData?.GetStationBoardResult?.trainServices?.service ?? []) {
|
||||||
services = [...jsonData.GetStationBoardResult.trainServices.service];
|
services = [...jsonData.GetStationBoardResult.trainServices.service];
|
||||||
} else {
|
} else {
|
||||||
services = ["No train services available"];
|
services = ["No train services available"];
|
||||||
|
Loading…
Reference in New Issue
Block a user