伊予若宮信号所の処理を詳細化
This commit is contained in:
@@ -249,7 +249,35 @@ export const EachTrainInfoCore = ({
|
||||
|
||||
useEffect(() => {
|
||||
const position = getPosition(currentTrainData);
|
||||
if (position) setCurrentPosition(position);
|
||||
if (position) {
|
||||
if (position.length > 1) {
|
||||
if (position[0] == "-Iyo") {
|
||||
position[0] =
|
||||
stopStationIDList[
|
||||
stopStationIDList.findIndex((d) => d.includes("U14")) - 1
|
||||
][0];
|
||||
}
|
||||
else if (position[0] == "+Iyo") {
|
||||
position[0] =
|
||||
stopStationIDList[
|
||||
stopStationIDList.findIndex((d) => d.includes("U14")) + 1
|
||||
][0];
|
||||
}
|
||||
if (position[1] == "+Iyo") {
|
||||
position[1] =
|
||||
stopStationIDList[
|
||||
stopStationIDList.findIndex((d) => d.includes("U14")) + 1
|
||||
][0];
|
||||
}else if (position[1] == "-Iyo") {
|
||||
position[1] =
|
||||
stopStationIDList[
|
||||
stopStationIDList.findIndex((d) => d.includes("U14")) - 1
|
||||
][0];
|
||||
}
|
||||
}
|
||||
|
||||
setCurrentPosition(position);
|
||||
}
|
||||
}, [currentTrainData]);
|
||||
|
||||
useEffect(() => {
|
||||
|
Reference in New Issue
Block a user