Avoid showing duplicate entry dialog for same entry

Fixes #9772

(cherry picked from commit fd30c0adcdfc0efc0aae9e5401843439f2622070)
This commit is contained in:
arkon
2023-07-29 12:07:13 -04:00
committed by Jobobby04
parent cc297da44a
commit 9760cb101d
6 changed files with 9 additions and 9 deletions
@@ -430,7 +430,7 @@ open class BrowseSourceScreenModel(
}
suspend fun getDuplicateLibraryManga(manga: Manga): Manga? {
return getDuplicateLibraryManga.await(manga.title)
return getDuplicateLibraryManga.await(manga).getOrNull(0)
}
private fun moveMangaToCategories(manga: Manga, vararg categories: Category) {
@@ -705,7 +705,7 @@ class MangaScreenModel(
// Add to library
// First, check if duplicate exists if callback is provided
if (checkDuplicate) {
val duplicate = getDuplicateLibraryManga.await(manga.title)
val duplicate = getDuplicateLibraryManga.await(manga).getOrNull(0)
if (duplicate != null) {
updateSuccessState { it.copy(dialog = Dialog.DuplicateManga(manga, duplicate)) }