Check for duplicated library manga on add to library

This commit is contained in:
schroda
2024-05-04 14:43:41 +02:00
parent c29173681f
commit f66051d398
5 changed files with 115 additions and 26 deletions

View File

@@ -233,6 +233,13 @@ export class Mangas {
return requestManager.getValidImgUrlFor(thumbnailUrl);
}
static getDuplicateLibraryMangas(title: string): ReturnType<typeof requestManager.getMangas> {
return requestManager.getMangas({
condition: { inLibrary: true },
filter: { title: { likeInsensitive: title } },
});
}
static async getChapterIdsWithState(
mangaIds: number[],
state: Pick<ChapterConditionInput, 'isRead' | 'isDownloaded' | 'isBookmarked'>,

View File

@@ -36,6 +36,10 @@ export const awaitConfirmation = async (
<ThemeProvider theme={getCurrentTheme()}>
<ConfirmDialog
{...dialogProps}
onExtra={() => {
handleConfirmation(false);
dialogProps.onExtra?.();
}}
onCancel={() => handleConfirmation(false)}
onConfirm={() => handleConfirmation(true)}
/>