From 40e41b26a19f4a47582acf9e71272c80abda9396 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sun, 15 May 2022 15:10:34 +0100 Subject: [PATCH] fix: Missing not found page closes #3476 closes #3531 --- app/routes/authenticated.tsx | 20 +++++++++++++++----- app/routes/settings.tsx | 2 ++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/app/routes/authenticated.tsx b/app/routes/authenticated.tsx index 79cbe3bc8..9f9533cbd 100644 --- a/app/routes/authenticated.tsx +++ b/app/routes/authenticated.tsx @@ -1,11 +1,9 @@ import * as React from "react"; import { Switch, Redirect, RouteComponentProps } from "react-router-dom"; import Archive from "~/scenes/Archive"; -import Collection from "~/scenes/Collection"; import DocumentNew from "~/scenes/DocumentNew"; import Drafts from "~/scenes/Drafts"; import Error404 from "~/scenes/Error404"; -import Search from "~/scenes/Search"; import Templates from "~/scenes/Templates"; import Trash from "~/scenes/Trash"; import Layout from "~/components/AuthenticatedLayout"; @@ -29,6 +27,13 @@ const Document = React.lazy( "~/scenes/Document" ) ); +const Collection = React.lazy( + () => + import( + /* webpackChunkName: "collection" */ + "~/scenes/Collection" + ) +); const Home = React.lazy( () => import( @@ -36,8 +41,13 @@ const Home = React.lazy( "~/scenes/Home" ) ); - -const NotFound = () => ; +const Search = React.lazy( + () => + import( + /* webpackChunkName: "search" */ + "~/scenes/Search" + ) +); const RedirectDocument = ({ match, @@ -86,7 +96,7 @@ export default function AuthenticatedRoutes() { - + diff --git a/app/routes/settings.tsx b/app/routes/settings.tsx index 0c63a1781..50e16f07e 100644 --- a/app/routes/settings.tsx +++ b/app/routes/settings.tsx @@ -1,5 +1,6 @@ import * as React from "react"; import { Switch, Redirect } from "react-router-dom"; +import Error404 from "~/scenes/Error404"; import Route from "~/components/ProfiledRoute"; import useAuthorizedSettingsConfig from "~/hooks/useAuthorizedSettingsConfig"; @@ -20,6 +21,7 @@ export default function SettingsRoutes() { + ); }