Skip to content

Commit

Permalink
Effectively don't trigger search when query <3
Browse files Browse the repository at this point in the history
  • Loading branch information
StaehliJ committed Nov 2, 2023
1 parent ed03b02 commit 8ae728a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class SearchViewModel(private val ilRepository: ILRepository) : ViewModel() {
*/
@OptIn(ExperimentalCoroutinesApi::class)
val result: Flow<PagingData<SearchContent>> = config.flatMapLatest { config ->
if (config.query.isNotBlank() || config.query.length >= 3) {
if (config.query.length >= 3) {
ilRepository.search(config.bu, config.query).map { mediaPagingData ->
val pagingData: PagingData<SearchContent> = mediaPagingData.map { item -> SearchContent.MediaResult(Content.Media(item)) }
pagingData.insertHeaderItem(item = SearchContent.BuSelector)
Expand Down

0 comments on commit 8ae728a

Please sign in to comment.