mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-05-19 14:10:38 -04:00
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:
@@ -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) {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user