Skip to content

Commit

Permalink
dashboard: fix route path (#1009)
Browse files Browse the repository at this point in the history
* fix route path

Signed-off-by: Teo Koon Peng <[email protected]>

* show not found page when page not found under baseurl

Signed-off-by: Teo Koon Peng <[email protected]>

---------

Signed-off-by: Teo Koon Peng <[email protected]>
  • Loading branch information
koonpeng authored Sep 6, 2024
1 parent 63ee3a6 commit d9361c1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/dashboard/src/components/rmf-dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ function DashboardContents({
extraAppbarItems,
}: DashboardContentsProps) {
const location = useLocation();
const currentTab = tabs.find((t) => matchPath(t.route, location.pathname));
const currentTab = tabs.find((t) => matchPath(`${baseUrl}${t.route}`, location.pathname));

const [pendingTransition, startTransition] = useTransition();
const navigate = useNavigate();
Expand Down Expand Up @@ -335,6 +335,7 @@ function DashboardContents({
/>
))}
</Route>
<Route path="*" element={<NotFound />} />
</Route>
<Route path="*" element={<NotFound />} />
</Routes>
Expand Down

0 comments on commit d9361c1

Please sign in to comment.