Fix hidden items filter no longer working

Close #965
This commit is contained in:
MM20 2024-07-22 18:11:45 +02:00
parent 38d8bcc07c
commit 2e7a4c435f
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389

View File

@ -45,6 +45,7 @@ import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.flow.flatMapLatest
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.shareIn
import kotlinx.coroutines.flow.stateIn
@ -211,10 +212,14 @@ class SearchVM : ViewModel(), KoinComponent {
searchJob = viewModelScope.launch {
if (query.isEmpty()) {
val hiddenItemKeys = searchableRepository.getKeys(
val hiddenItemKeys = if (!filters.hiddenItems) {
searchableRepository.getKeys(
maxVisibility = VisibilityLevel.SearchOnly,
includeTypes = listOf("app"),
)
} else {
flowOf(emptyList())
}
val allApps = searchService.getAllApps()
fileResults.value = emptyList()
contactResults.value = emptyList()