diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryScreenModel.kt index acc922e5c..e5411fd84 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryScreenModel.kt @@ -530,10 +530,7 @@ class LibraryScreenModel( } fun showSettingsDialog() { - mutableState.update { - val category = it.categories.getOrNull(activeCategoryIndex) ?: return@update it - it.copy(dialog = Dialog.SettingsSheet(category)) - } + mutableState.update { it.copy(dialog = Dialog.SettingsSheet) } } fun clearSelection() { @@ -654,7 +651,7 @@ class LibraryScreenModel( } sealed class Dialog { - data class SettingsSheet(val category: Category) : Dialog() + object SettingsSheet : Dialog() data class ChangeCategory(val manga: List, val initialSelection: List>) : Dialog() data class DeleteManga(val manga: List) : Dialog() } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryTab.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryTab.kt index f80ef0716..cdf60ae05 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryTab.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryTab.kt @@ -205,13 +205,11 @@ object LibraryTab : Tab { val onDismissRequest = screenModel::closeDialog when (val dialog = state.dialog) { - is LibraryScreenModel.Dialog.SettingsSheet -> { - LibrarySettingsDialog( - onDismissRequest = onDismissRequest, - screenModel = settingsScreenModel, - category = dialog.category, - ) - } + is LibraryScreenModel.Dialog.SettingsSheet -> LibrarySettingsDialog( + onDismissRequest = onDismissRequest, + screenModel = settingsScreenModel, + category = state.categories[screenModel.activeCategoryIndex], + ) is LibraryScreenModel.Dialog.ChangeCategory -> { ChangeCategoryDialog( initialSelection = dialog.initialSelection,