From 7f8a77d9fa15ce38bf12746bd1b6911550744b10 Mon Sep 17 00:00:00 2001 From: harukin-DeskMini Date: Sun, 29 Jan 2023 08:57:31 +0900 Subject: [PATCH] =?UTF-8?q?=E6=A4=9C=E7=9F=A5=E6=97=A5=E6=9C=AC=E8=AA=9E?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/発車時刻表/LED_vidion.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/発車時刻表/LED_vidion.js b/components/発車時刻表/LED_vidion.js index 17fc581..4458f22 100644 --- a/components/発車時刻表/LED_vidion.js +++ b/components/発車時刻表/LED_vidion.js @@ -124,10 +124,11 @@ export default function LED_vision(props) { const returnData = Object.keys(stationDiagram).map((d) => { let a = {}; stationDiagram[d].split("#").forEach((data) => { + console.log(data); if (data.match("着")) { a.lastStation = data.split(",着,")[0]; } - if (data.match(station.Station_JP)) { + if (data.split(",")[0] === station.Station_JP) { if (data.match(",発,")) { a.time = data.split(",発,")[1]; } else { @@ -451,6 +452,7 @@ const StatusAndDelay = ({ currentTrain, d, props, trainDescriptionSwitch }) => { const [status, setStatus] = useState(""); useEffect(() => { const current = currentTrain.filter((a) => a.num == d.train)[0]; + if (!current) return () => {}; const delay = current.delay; switch (true) { case delay === "入線":