From 8726cf35b9a3e197e7a271cde53cbd530acad444 Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Sun, 20 Oct 2024 12:21:35 +0000 Subject: [PATCH] =?UTF-8?q?=E5=88=97=E8=BB=8A=E4=BD=8D=E7=BD=AE=E3=82=A2?= =?UTF-8?q?=E3=82=A4=E3=82=B3=E3=83=B3=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EachTrainInfoCore.js | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/components/ActionSheetComponents/EachTrainInfoCore.js b/components/ActionSheetComponents/EachTrainInfoCore.js index 5c283d9..e73893e 100644 --- a/components/ActionSheetComponents/EachTrainInfoCore.js +++ b/components/ActionSheetComponents/EachTrainInfoCore.js @@ -257,9 +257,41 @@ export const EachTrainInfoCore = ({ if (currentTrainData?.Pos.match("~")) { const pos = currentTrainData?.Pos.replace("(下り)", "") .replace("(上り)", "") + .replace("(徳島線)", "") + .replace("(高徳線)", "") .split("~"); const direction = parseInt(currentTrainData?.Direction) || 0; - if (direction == 0) { + if (pos[0] == "児島" && pos[1] == "宇多津") { + setCurrentPosition(["M12", "Y09"]); + return; + } else if (pos[1] == "児島" && pos[0] == "宇多津") { + setCurrentPosition(["Y09", "M12"]); + return; + } + const currentPosID = Object.keys(originalStationList).map((key) => { + let firstStation = false; + let firstStationID = ""; + let secondStation = false; + let secondStationID = ""; + originalStationList[key].forEach((station) => { + if (station.Station_JP === pos[0]) { + firstStation = true; + firstStationID = station.StationNumber; + } + if (station.Station_JP === pos[1]) { + secondStation = true; + secondStationID = station.StationNumber; + } + }); + if (firstStation && secondStation) { + return [firstStationID, secondStationID]; + } else return false; + }); + const currentPos = currentPosID.filter((d) => d != false)[0]; + if (currentPos) { + if (direction == 0) setCurrentPosition(currentPos.reverse()); + else setCurrentPosition(currentPos); + } else if (direction == 0) { setCurrentPosition([ getStationID(pos[1], stationList), getStationID(pos[0], stationList),