diff --git a/Apps.js b/Apps.js index a405cb9..5afa461 100644 --- a/Apps.js +++ b/Apps.js @@ -362,6 +362,7 @@ export default function Apps({ navigation, webview, stationData }) { originalStationList, openStationACFromEachTrainInfo, from: "Train", + setTrainInfo, }} /> diff --git a/components/ActionSheetComponents/EachTrainInfoCore.js b/components/ActionSheetComponents/EachTrainInfoCore.js index e30f5a3..d761b43 100644 --- a/components/ActionSheetComponents/EachTrainInfoCore.js +++ b/components/ActionSheetComponents/EachTrainInfoCore.js @@ -43,6 +43,7 @@ export const EachTrainInfoCore = ({ originalStationList, openStationACFromEachTrainInfo, from, + setTrainInfo, }) => { // const [actionSheetHorizonalScroll, setActionSheetHorizonalScroll] = useState(false); @@ -198,12 +199,16 @@ export const EachTrainInfoCore = ({ originalStationList, from: "AllTrainDiagramView", }; - SheetManager.hide("EachTrainInfo").then(() => { - //0.1秒待機してから開く - setTimeout(() => { - SheetManager.show("EachTrainInfo", { payload }); - }, 1); - }); + if (setTrainInfo) { + setTrainInfo(payload.data); + } else { + SheetManager.hide("EachTrainInfo").then(() => { + //0.1秒待機してから開く + setTimeout(() => { + SheetManager.show("EachTrainInfo", { payload }); + }, 1); + }); + } }; return ( { try { - if (!stopStationIDList.length) return []; + if (!stopStationIDList) return []; // arrayが二次元配列だったら早期リターン if (!array instanceof Array) return []; - if (!array.length) return []; + if (!array) return []; if (array[0] instanceof Array) return []; const arrayNumber = array.map((d) => ({ line: d