Sort duplicated library manga by title
This commit is contained in:
@@ -167,10 +167,16 @@ export const LibraryDuplicates = () => {
|
|||||||
return findDuplicatesByTitle(libraryMangas);
|
return findDuplicatesByTitle(libraryMangas);
|
||||||
}, [data?.mangas.nodes, checkAlternativeTitles]);
|
}, [data?.mangas.nodes, checkAlternativeTitles]);
|
||||||
|
|
||||||
const duplicatedTitles = useMemo(() => Object.keys(mangasByTitle), [mangasByTitle]);
|
const duplicatedTitles = useMemo(
|
||||||
const duplicatedMangas = useMemo(() => Object.values(mangasByTitle).flat(), [mangasByTitle]);
|
() => Object.keys(mangasByTitle).toSorted((titleA, titleB) => titleA.localeCompare(titleB)),
|
||||||
|
[mangasByTitle],
|
||||||
|
);
|
||||||
|
const duplicatedMangas = useMemo(
|
||||||
|
() => duplicatedTitles.map((title) => mangasByTitle[title]).flat(),
|
||||||
|
[mangasByTitle],
|
||||||
|
);
|
||||||
const mangasCountByTitle = useMemo(
|
const mangasCountByTitle = useMemo(
|
||||||
() => Object.values(mangasByTitle).map((mangas) => mangas.length),
|
() => duplicatedTitles.map((title) => mangasByTitle[title]).map((mangas) => mangas.length),
|
||||||
[mangasByTitle],
|
[mangasByTitle],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user