From fe8df6af2e4c871811953c42e75c8dede4c9de89 Mon Sep 17 00:00:00 2001 From: harukin-OneMix4 Date: Wed, 14 Feb 2024 01:28:24 +0900 Subject: [PATCH] =?UTF-8?q?=E6=81=90=E3=82=89=E3=81=8F=E9=96=A2=E9=80=A3?= =?UTF-8?q?=E5=88=97=E8=BB=8A=E3=83=9C=E3=82=BF=E3=83=B3=E3=81=8C=E5=8B=95?= =?UTF-8?q?=E4=BD=9C=E3=81=97=E3=81=AA=E3=81=84=E3=83=90=E3=82=B0=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Apps.js | 1 + .../ActionSheetComponents/EachTrainInfoCore.js | 17 +++++++++++------ lib/eachTrainInfoCoreLib/findReversalPoints.js | 4 ++-- 3 files changed, 14 insertions(+), 8 deletions(-) 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