From 94a52936e53ee75b5073b0eee9163f2c6a5b7d01 Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Sat, 31 Aug 2024 10:07:46 +0000 Subject: [PATCH] =?UTF-8?q?=E8=B7=AF=E7=B7=9A=E9=81=95=E3=81=84=E3=81=AE?= =?UTF-8?q?=E5=B7=A6=E5=8F=B3=E9=A7=85=E3=81=AE=E6=83=85=E5=A0=B1=E3=82=92?= =?UTF-8?q?=E4=B8=A1=E6=96=B9=E8=A1=A8=E7=A4=BA=E5=8F=AF=E8=83=BD=E3=81=AB?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/駅名表/Sign.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/駅名表/Sign.js b/components/駅名表/Sign.js index 9aec1c8..1b3db64 100644 --- a/components/駅名表/Sign.js +++ b/components/駅名表/Sign.js @@ -64,6 +64,8 @@ export default function Sign(props) { useEffect(() => { setNexPrePosition(0); getPreNextStation(currentStation[0]); + if(currentStation.length == 1)return ()=>{}; + getPreNextStation(currentStation[1]); }, [currentStation]); useEffect(() => { @@ -94,8 +96,8 @@ export default function Sign(props) { ]; } }); - setPreStation(returnData[0]); - setNexStation(returnData[1]); + if(returnData[0])setPreStation(returnData[0]); + if(returnData[1])setNexStation(returnData[1]); }; const isMatsuyama = currentStation[0].StationNumber == "Y55"; //const isMatsuyama = true;