From 81785748156fbec46ced6ef235923dd0300ab714 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Sun, 14 Apr 2024 18:08:15 +0200 Subject: [PATCH] Fix/remove deprecated routes (#747) * Route to "/" in case path is unknown * Remove deprecated routes "sources" and "extensions" were merged into "browse" but the routes were never removed, thus, the paths still matched and opened the components --- src/App.tsx | 6 ++---- src/screens/SearchAll.tsx | 2 +- src/screens/SourceMangas.tsx | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 27ab88e0..3748f75f 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -14,7 +14,6 @@ import { loadErrorMessages, loadDevMessages } from '@apollo/client/dev'; import { AppContext } from '@/components/context/AppContext'; import { Browse } from '@/screens/Browse'; import { DownloadQueue } from '@/screens/DownloadQueue'; -import { Extensions } from '@/screens/Extensions'; import { Library } from '@/screens/Library'; import { Manga } from '@/screens/Manga'; import { Reader } from '@/screens/Reader'; @@ -26,7 +25,6 @@ import { Categories } from '@/screens/settings/Categories'; import { DefaultReaderSettings } from '@/screens/settings/DefaultReaderSettings'; import { SourceConfigure } from '@/screens/SourceConfigure'; import { SourceMangas } from '@/screens/SourceMangas'; -import { Sources } from '@/screens/Sources'; import { Updates } from '@/screens/Updates'; import '@/i18n'; import { LibrarySettings } from '@/screens/settings/LibrarySettings'; @@ -94,6 +92,7 @@ export const App: React.FC = () => ( {/* General Routes */} } /> + } /> } /> } /> @@ -112,7 +111,7 @@ export const App: React.FC = () => ( {/* Manga Routes */} - } /> + } /> } /> } /> } /> @@ -124,7 +123,6 @@ export const App: React.FC = () => ( } /> } /> - } /> } /> } /> diff --git a/src/screens/SearchAll.tsx b/src/screens/SearchAll.tsx index 25569806..ccf0eb6e 100644 --- a/src/screens/SearchAll.tsx +++ b/src/screens/SearchAll.tsx @@ -166,7 +166,7 @@ export const SearchAll: React.FC = () => { const { setTitle, setAction } = useContext(NavBarContext); - useSetDefaultBackTo('sources'); + useSetDefaultBackTo('browse'); const { pathname, state } = useLocation<{ mangaTitle?: string }>(); const isMigrateMode = pathname.startsWith('/migrate/source'); diff --git a/src/screens/SourceMangas.tsx b/src/screens/SourceMangas.tsx index 3c679ab0..734de31a 100644 --- a/src/screens/SourceMangas.tsx +++ b/src/screens/SourceMangas.tsx @@ -225,7 +225,7 @@ export function SourceMangas() { clearCache: boolean; }>().state ?? {}; - useSetDefaultBackTo('sources'); + useSetDefaultBackTo('browse'); const [isFirstRender, setIsFirstRender] = useState(true);