Преглед на файлове

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 <[email protected]>
Houssein Zaghdane преди 1 година
родител
ревизия
6ce42dc167
променени са 1 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 3 3
      app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt

+ 3 - 3
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)
-                }
             }
         }
     }