mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-21 15:51:49 +01:00
Revert "Avoid potential crash when opening library settings sheet (#9415)"
This reverts commit 2cb08e6bb1
.
This commit is contained in:
parent
c21813a8b5
commit
c590f55030
@ -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<Manga>, val initialSelection: List<CheckboxState<Category>>) : Dialog()
|
||||
data class DeleteManga(val manga: List<Manga>) : Dialog()
|
||||
}
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user