diff --git a/src/global/AppRouter.tsx b/src/global/AppRouter.tsx index 8491340..6199280 100644 --- a/src/global/AppRouter.tsx +++ b/src/global/AppRouter.tsx @@ -1,6 +1,8 @@ // Copyright (c) 2020-2021 Drew Lemmy // This file is part of KristWeb 2 under GPL-3.0. // Full details: https://github.com/tmpim/KristWeb2/blob/master/LICENSE.txt +import { Alert } from "antd"; + import { Switch, Route } from "react-router-dom"; import { DashboardPage } from "@pages/dashboard/DashboardPage"; @@ -89,8 +91,16 @@ export function AppRouter(): JSX.Element { return + {/* Render the matched route's page component */} {APP_ROUTES.map(({ path, component }, key) => ( - component && {component} + component && ( + + {/* Try to catch errors on a route without crashing everything */} + + {component} + + + ) ))}