From 17390b4ed93d628435a6c168eb3bf8c42c73f467 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Tue, 2 Dec 2025 22:00:19 +0100 Subject: [PATCH] Fix manga page "in library" button after click on "show duplicate entry" --- CHANGELOG.md | 1 + src/features/manga/hooks/useManageMangaLibraryState.tsx | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cdd6e87a..ec23802b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). - (**Manga**) Fix showing private tracking option for trackers which do not support the option - (**Manga**) Fix redirection to tracker settings in case no tracker is logged in - (**Manga**) Fix closing the category select dialog after clicking edit/create button while adding an entry to the library +- (**Manga**) Fix "in library" button after clicking "show duplicate entry" in the "duplicate entry detected" dialog - (**Library**) Fix showing incorrect info text for an empty category - (**Browse**) Prevent infinite loading in case the whole source catalogue has been added to the library and the "hide entries in library" setting is enabled - (**Browse**) Fix using incorrect native language name for some sources (e.g., different chinese languages (zh-hans, zh-hant, ...) were all showing the same native name) diff --git a/src/features/manga/hooks/useManageMangaLibraryState.tsx b/src/features/manga/hooks/useManageMangaLibraryState.tsx index d583a3b9..69866222 100644 --- a/src/features/manga/hooks/useManageMangaLibraryState.tsx +++ b/src/features/manga/hooks/useManageMangaLibraryState.tsx @@ -6,7 +6,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -import { useCallback, useState } from 'react'; +import { useCallback, useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useNavigate } from 'react-router-dom'; import gql from 'graphql-tag'; @@ -33,6 +33,10 @@ export const useManageMangaLibraryState = ( const [isInLibrary, setIsInLibrary] = useState(!!manga.inLibrary); + useEffect(() => { + setIsInLibrary(!!manga.inLibrary); + }, [manga.id]); + const addToLibrary = useCallback( (addToCategories: number[] = [], removeFromCategories: number[] = []) => { requestManager