diff options
Diffstat (limited to 'src/frontend/app/routes/estimates-$id.tsx')
| -rw-r--r-- | src/frontend/app/routes/estimates-$id.tsx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/frontend/app/routes/estimates-$id.tsx b/src/frontend/app/routes/estimates-$id.tsx index 4502d9e..81c83ea 100644 --- a/src/frontend/app/routes/estimates-$id.tsx +++ b/src/frontend/app/routes/estimates-$id.tsx @@ -1,5 +1,5 @@ import { type JSX, useEffect, useState, useCallback } from "react"; -import { useParams, Link } from "react-router"; +import { useParams, Link, Navigate } from "react-router"; import StopDataProvider, { type Stop } from "../data/StopDataProvider"; import { Star, Edit2, ExternalLink, RefreshCw } from "lucide-react"; import "./estimates-$id.css"; @@ -105,6 +105,11 @@ export default function Estimates() { const { tableStyle, region } = useApp(); const regionConfig = getRegionConfig(region); + // Redirect to /stops/$id if table style is experimental_consolidated + if (tableStyle === "experimental_consolidated") { + return <Navigate to={`/stops/${params.id}`} replace />; + } + const parseError = (error: any): ErrorInfo => { if (!navigator.onLine) { return { type: "network", message: "No internet connection" }; @@ -171,10 +176,6 @@ export default function Estimates() { } }, [params.id, region, regionConfig.timetableEndpoint]); - const refreshData = useCallback(async () => { - await Promise.all([loadEstimatesData(), loadTimetableDataAsync()]); - }, [loadEstimatesData, loadTimetableDataAsync]); - // Manual refresh function for pull-to-refresh and button const handleManualRefresh = useCallback(async () => { try { @@ -299,7 +300,7 @@ export default function Estimates() { {stopData && stopData.lines && stopData.lines.length > 0 && ( <div - className={`estimates-lines-container ${stopData.lines.length >= 6 ? "scrollable" : ""}`} + className={`estimates-lines-container`} > {stopData.lines.map((line) => ( <div key={line} className="estimates-line-icon"> |
