Don't show category chip for the category of current list

all apps will be in that category so it doesn't make sense to filter for that
This commit is contained in:
Torsten Grote
2026-01-26 15:39:07 -03:00
parent 19788ffb34
commit fb33959863
2 changed files with 8 additions and 1 deletions

View File

@@ -15,6 +15,7 @@ import java.util.Locale
@Composable
fun AppListPresenter(
type: AppListType,
appsFlow: StateFlow<List<AppListItem>?>,
sortByFlow: StateFlow<AppListSortOrder>,
filterIncompatibleFlow: StateFlow<Boolean>,
@@ -40,7 +41,12 @@ fun AppListPresenter(
}
val filteredCategories = remember(categories, apps) {
categories?.filter {
it.id in availableCategoryIds
if (type is AppListType.Category) {
// don't show category for list we are currently seeing, because all apps are in it
it.id in availableCategoryIds && it.id != type.categoryId
} else {
it.id in availableCategoryIds
}
}
}
val availableRepositories = remember(apps) {

View File

@@ -86,6 +86,7 @@ class AppListViewModel @AssistedInject constructor(
val appListModel: StateFlow<AppListModel> by lazy(LazyThreadSafetyMode.NONE) {
moleculeScope.launchMolecule(mode = ContextClock) {
AppListPresenter(
type = type,
appsFlow = apps,
sortByFlow = sortBy,
filterIncompatibleFlow = filterIncompatible,