Skip to content

Commit

Permalink
chore: restore
Browse files Browse the repository at this point in the history
  • Loading branch information
NoamGaash committed Feb 7, 2025
1 parent c2b7797 commit 6d2726f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/routes/MainRoute.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const MainRoute = () => {
const [searchParams, setSearchParams] = useSearchParams()
const operatorId = searchParams.get('operatorId')
const lineNumber = searchParams.get('lineNumber')
const vehicleNumber = searchParams.get('vehicleNumber')
const routeKey = searchParams.get('routeKey')
const timestamp = searchParams.get('timestamp')

Expand All @@ -38,6 +39,7 @@ export const MainRoute = () => {
timestamp: +timestamp! || moment().valueOf(),
operatorId: operatorId || '',
lineNumber: lineNumber || '',
vehicleNumber: vehicleNumber ? Number(vehicleNumber) : undefined,
routeKey: routeKey || '',
})

Expand All @@ -54,13 +56,17 @@ export const MainRoute = () => {
if (search.lineNumber) {
params.set('lineNumber', search.lineNumber)
}
if (search.vehicleNumber) {
params.set('vehicleNumber', search.vehicleNumber.toString())
}
if (search.routeKey) {
params.set('routeKey', search.routeKey)
}
setSearchParams(params)
}
}, [
search.lineNumber,
search.vehicleNumber,
search.operatorId,
search.routeKey,
search.timestamp,
Expand Down
8 changes: 8 additions & 0 deletions src/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const GapsPage = lazy(() => import('../pages/gaps'))
const GapsPatternsPage = lazy(() => import('../pages/gapsPatterns'))
const TimeBasedMapPage = lazy(() => import('../pages/timeBasedMap'))
const SingleLineMapPage = lazy(() => import('../pages/singleLineMap'))
const SingleVehicleMapPage = lazy(() => import('../pages/singleVehicleMap'))
const About = lazy(() => import('../pages/about'))
const Profile = lazy(() => import('../pages/lineProfile/LineProfile'))
const BugReportForm = lazy(() => import('../pages/BugReportForm '))
Expand Down Expand Up @@ -81,6 +82,13 @@ export const PAGES = [
icon: <RadarChartOutlined />,
element: <SingleLineMapPage />,
},
{
label: 'singlevehicle_map_page_title',
path: '/single-vehicle-map',
searchParamsRequired: true,
icon: <RadarChartOutlined />,
element: <SingleVehicleMapPage />,
},
{
label: 'about_title',
path: '/about',
Expand Down

0 comments on commit 6d2726f

Please sign in to comment.