From 6ce42dc1676fe0a2e553edbc004c05eb3fd5df45 Mon Sep 17 00:00:00 2001 From: Houssein Zaghdane <46049558+zaghdaneh@users.noreply.github.com> Date: Wed, 3 May 2023 15:40:11 +0100 Subject: [PATCH] fix to multiple "add to library" toasts bug when adding a new series (#9433) fix to multiple "add to library" toasts bug (#9177) Co-authored-by: Houssein Zaghdane --- .../java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt index 1f268bedf9..ad5b340f42 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt @@ -605,6 +605,9 @@ class MangaInfoScreenModel( } if (!isFavorited && !successState.hasPromptedToAddBefore) { + updateSuccessState { successState -> + successState.copy(hasPromptedToAddBefore = true) + } coroutineScope.launch { val result = snackbarHostState.showSnackbar( message = context.getString(R.string.snack_add_to_library), @@ -614,9 +617,6 @@ class MangaInfoScreenModel( if (result == SnackbarResult.ActionPerformed && !isFavorited) { toggleFavorite() } - updateSuccessState { successState -> - successState.copy(hasPromptedToAddBefore = true) - } } } }