diff --git a/src/components/route-eta/TimeTableButton.tsx b/src/components/route-eta/TimeTableButton.tsx index 31c2ab3cbd3b..47d459d768f5 100644 --- a/src/components/route-eta/TimeTableButton.tsx +++ b/src/components/route-eta/TimeTableButton.tsx @@ -19,7 +19,7 @@ const TimeTableButton = ({ routeId }: { routeId: string }) => { startIcon={} onClick={() => setIsOpen(true)} > - {t("時間表")} + {t("車程")} { const { t } = useTranslation(); - const [tab, setTab] = useState<"schedule" | "jt">("schedule"); + const [tab, setTab] = useState<"schedule" | "jt">("jt"); const modalProps = useMemo(() => { return { @@ -33,11 +33,11 @@ const TimetableDrawer = ({ routeId, open, onClose }: TimetableDrawerProps) => { anchor="right" > setTab(v)} sx={tabbarSx}> - + - {tab === "schedule" && } {tab === "jt" && } + {tab === "schedule" && } ); }; diff --git a/src/components/route-eta/timetableDrawer/JourneyTimePanel.tsx b/src/components/route-eta/timetableDrawer/JourneyTimePanel.tsx index 1f239d4322c3..8c66d6a85adf 100644 --- a/src/components/route-eta/timetableDrawer/JourneyTimePanel.tsx +++ b/src/components/route-eta/timetableDrawer/JourneyTimePanel.tsx @@ -76,13 +76,21 @@ const JourneyTimePanel = ({ routeId }: JourneyTimePanelProps) => { stopList, batchSize: Math.max(Math.ceil((state.endSeq - state.startSeq) / 3), 6), signal: abortController.current.signal, - }).then((jt) => { - setState((prev) => ({ - ...prev, - jt: Math.round(jt), - isLoading: false, - })); - }); + }) + .then((jt) => { + setState((prev) => ({ + ...prev, + jt: Math.round(jt), + isLoading: false, + })); + }) + .catch((e) => { + console.error(e); + setState((prev) => ({ + ...prev, + isLoading: false, + })); + }); }, [route, state.endSeq, state.startSeq, stopList]); const stops = useMemo(() => {