From 9f5f101858b55624340999db9ad07e018662f6c0 Mon Sep 17 00:00:00 2001 From: stevenyomi <95685115+stevenyomi@users.noreply.github.com> Date: Sun, 31 Jul 2022 22:59:55 +0800 Subject: [PATCH] Dismiss clear database confirm dialog on success (#7657) --- .../more/settings/database/ClearDatabaseScreen.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/database/ClearDatabaseScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/database/ClearDatabaseScreen.kt index 0f5882bcec..2e0c87282b 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/database/ClearDatabaseScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/database/ClearDatabaseScreen.kt @@ -44,12 +44,14 @@ fun ClearDatabaseScreen( }, ) } - if (presenter.dialog is ClearDatabasePresenter.Dialog.Delete) { + val dialog = presenter.dialog + if (dialog is ClearDatabasePresenter.Dialog.Delete) { ClearDatabaseDeleteDialog( onDismissRequest = { presenter.dialog = null }, onDelete = { - presenter.removeMangaBySourceId((presenter.dialog as ClearDatabasePresenter.Dialog.Delete).sourceIds) + presenter.removeMangaBySourceId(dialog.sourceIds) presenter.clearSelection() + presenter.dialog = null context.toast(R.string.clear_database_completed) }, )