diff --git a/components/ActionSheetComponents/EachTrainInfo/EachStopList.tsx b/components/ActionSheetComponents/EachTrainInfo/EachStopList.tsx index 259c64a..e5eb06a 100644 --- a/components/ActionSheetComponents/EachTrainInfo/EachStopList.tsx +++ b/components/ActionSheetComponents/EachTrainInfo/EachStopList.tsx @@ -8,7 +8,7 @@ type seTypes = "発編" | "着編" | "通編" | "頃編" | "発" | "着" | strin type currentTrainDataType = { Index: number; num: string; - delay: "入線" | number; + delay: "入線" | number | undefined; Pos: string; PosNum: number; Direction: number; @@ -128,22 +128,24 @@ export const EachStopList: FC = ({ )} - {currentTrainData.delay != "入線" && currentTrainData?.delay != 0 && ( - - {time} - - )} + {currentTrainData?.delay && + currentTrainData?.delay != "入線" && + currentTrainData?.delay != 0 && ( + + {time} + + )} = (props) => { }; type StationTimeBoxType = { - delay: "入線" | number; + delay: "入線" | number | undefined; textColor: string; seType: seTypes; se: string; @@ -198,13 +200,16 @@ const StationTimeBox: FC = (props) => { const dates = dayjs() .set("hour", parseInt(time.split(":")[0])) .set("minute", parseInt(time.split(":")[1])) - .add(delay == "入線" ? 0 : delay, "minute"); + .add(delay == "入線" || delay == undefined ? 0 : delay, "minute"); const timeString = se == "通過" ? "" : dates.format("HH:mm"); return ( - + Twitterで検索