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 <zaghdane@fireflow.de>
(cherry picked from commit 6ce42dc1676fe0a2e553edbc004c05eb3fd5df45)
This commit is contained in:
Houssein Zaghdane 2023-05-03 15:40:11 +01:00 committed by Jobobby04
parent c7a180984e
commit fe0f9f053b

View File

@ -1085,6 +1085,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),
@ -1094,9 +1097,6 @@ class MangaInfoScreenModel(
if (result == SnackbarResult.ActionPerformed && !isFavorited) {
toggleFavorite()
}
updateSuccessState { successState ->
successState.copy(hasPromptedToAddBefore = true)
}
}
}
}