mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-15 13:37:29 +01:00
Remove alphabetical category sort option (#1781)
This commit is contained in:
@@ -13,7 +13,6 @@ import eu.kanade.presentation.category.CategoryScreen
|
||||
import eu.kanade.presentation.category.components.CategoryCreateDialog
|
||||
import eu.kanade.presentation.category.components.CategoryDeleteDialog
|
||||
import eu.kanade.presentation.category.components.CategoryRenameDialog
|
||||
import eu.kanade.presentation.category.components.CategorySortAlphabeticallyDialog
|
||||
import eu.kanade.presentation.util.Screen
|
||||
import eu.kanade.tachiyomi.util.system.toast
|
||||
import kotlinx.collections.immutable.toImmutableList
|
||||
@@ -40,7 +39,6 @@ class CategoryScreen : Screen() {
|
||||
CategoryScreen(
|
||||
state = successState,
|
||||
onClickCreate = { screenModel.showDialog(CategoryDialog.Create) },
|
||||
onClickSortAlphabetically = { screenModel.showDialog(CategoryDialog.SortAlphabetically) },
|
||||
onClickRename = { screenModel.showDialog(CategoryDialog.Rename(it)) },
|
||||
onClickDelete = { screenModel.showDialog(CategoryDialog.Delete(it)) },
|
||||
onChangeOrder = screenModel::changeOrder,
|
||||
@@ -71,12 +69,6 @@ class CategoryScreen : Screen() {
|
||||
category = dialog.category.name,
|
||||
)
|
||||
}
|
||||
is CategoryDialog.SortAlphabetically -> {
|
||||
CategorySortAlphabeticallyDialog(
|
||||
onDismissRequest = screenModel::dismissDialog,
|
||||
onSort = { screenModel.sortAlphabetically() },
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
LaunchedEffect(Unit) {
|
||||
|
||||
@@ -65,18 +65,9 @@ class CategoryScreenModel(
|
||||
}
|
||||
}
|
||||
|
||||
fun sortAlphabetically() {
|
||||
screenModelScope.launch {
|
||||
when (reorderCategory.sortAlphabetically()) {
|
||||
is ReorderCategory.Result.InternalError -> _events.send(CategoryEvent.InternalError)
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun changeOrder(category: Category, newIndex: Int) {
|
||||
screenModelScope.launch {
|
||||
when (reorderCategory.changeOrder(category, newIndex)) {
|
||||
when (reorderCategory.await(category, newIndex)) {
|
||||
is ReorderCategory.Result.InternalError -> _events.send(CategoryEvent.InternalError)
|
||||
else -> {}
|
||||
}
|
||||
@@ -113,7 +104,6 @@ class CategoryScreenModel(
|
||||
|
||||
sealed interface CategoryDialog {
|
||||
data object Create : CategoryDialog
|
||||
data object SortAlphabetically : CategoryDialog
|
||||
data class Rename(val category: Category) : CategoryDialog
|
||||
data class Delete(val category: Category) : CategoryDialog
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user