From cce6ec0113f0d88f02fb748b7c297438f4ce12e5 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Thu, 8 Jun 2023 13:40:08 +0200 Subject: [PATCH] Preserve "SourceMangas" location state (#354) Due to setting the "defaultBackTo" url the back button was a Link instead of a normal Button. The Link causes the page to get opened like it's the first time and to get put on top of the browsers history stack. Instead of actually going back in the history. Thus, the previous location state of the "SourceMangas" page was lost and the content type (browse, latest, filter) couldn't be reopened. --- src/screens/Manga.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/screens/Manga.tsx b/src/screens/Manga.tsx index 979820f9..9339d68d 100644 --- a/src/screens/Manga.tsx +++ b/src/screens/Manga.tsx @@ -12,7 +12,7 @@ import React, { useContext, useEffect, useRef } from 'react'; import { useTranslation } from 'react-i18next'; import { useParams } from 'react-router-dom'; import requestManager from '@/lib/RequestManager'; -import NavbarContext, { useSetDefaultBackTo } from '@/components/context/NavbarContext'; +import NavbarContext from '@/components/context/NavbarContext'; import ChapterList from '@/components/manga/ChapterList'; import { useRefreshManga } from '@/components/manga/hooks'; import MangaDetails from '@/components/manga/MangaDetails'; @@ -33,10 +33,6 @@ const Manga: React.FC = () => { const [refresh, { loading: refreshing }] = useRefreshManga(id); - useSetDefaultBackTo( - manga?.inLibrary === false && manga.sourceId != null ? `/sources/${manga.sourceId}` : '/library', - ); - useEffect(() => { // Automatically fetch manga from source if data is older then 24 hours // Automatic fetch is done only once, to prevent issues when server does