UpdatesScreen: Fix selection state after deleting download (#8100)
(cherry picked from commit 633bd6eb462ee187fb3c1d6c3f8f025cb0f9eedc)
This commit is contained in:
parent
b1b05fa313
commit
1f444185da
@ -196,8 +196,8 @@ private fun UpdateScreenContent(
|
||||
UpdatesDeleteConfirmationDialog(
|
||||
onDismissRequest = onDismissDialog,
|
||||
onConfirm = {
|
||||
presenter.deleteChapters(dialog.toDelete)
|
||||
presenter.toggleAllSelection(false)
|
||||
presenter.deleteChapters(dialog.toDelete)
|
||||
},
|
||||
)
|
||||
}
|
||||
|
@ -219,6 +219,7 @@ class MangaController : FullComposeController<MangaPresenter> {
|
||||
DeleteChaptersDialog(
|
||||
onDismissRequest = onDismissRequest,
|
||||
onConfirm = {
|
||||
presenter.toggleAllSelection(false)
|
||||
deleteChapters(dialog.chapters)
|
||||
},
|
||||
)
|
||||
|
@ -1136,6 +1136,7 @@ class MangaPresenter(
|
||||
|
||||
/**
|
||||
* Deletes the given list of chapter.
|
||||
*
|
||||
* @param chapters the list of chapters to delete.
|
||||
*/
|
||||
fun deleteChapters(chapters: List<DomainChapter>) {
|
||||
@ -1163,7 +1164,6 @@ class MangaPresenter(
|
||||
}
|
||||
successState.copy(chapters = newChapters)
|
||||
}
|
||||
toggleAllSelection(false)
|
||||
} catch (e: Throwable) {
|
||||
logcat(LogPriority.ERROR, e)
|
||||
}
|
||||
|
@ -276,7 +276,7 @@ class UpdatesPresenter(
|
||||
if (deletedUpdates.isEmpty()) return@launchNonCancellable
|
||||
|
||||
// TODO: Don't do this fake status update
|
||||
state.items = items.toMutableList().apply {
|
||||
state.items = state.items.toMutableList().apply {
|
||||
deletedUpdates.forEach { deletedUpdate ->
|
||||
val modifiedIndex = indexOf(deletedUpdate)
|
||||
val item = removeAt(modifiedIndex).copy(
|
||||
|
Loading…
x
Reference in New Issue
Block a user