Fix manga page "in library" button after click on "show duplicate entry"

This commit is contained in:
schroda
2025-12-02 22:00:19 +01:00
parent 13d6d1e525
commit 17390b4ed9
2 changed files with 6 additions and 1 deletions

View File

@@ -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