Skip to content

Commit

Permalink
[ANDROAPP-5800] enable disable search button on empty parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
andresmr committed Feb 16, 2024
1 parent 6824e1a commit 73ce7a7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ class SearchTEIViewModel(
),
)
}
uiState = uiState.copy(searchEnabled = queryData.isNotEmpty())
}

fun fetchListResults(onPagedListReady: (Flow<PagingData<SearchTeiModel>>?) -> Unit) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ fun SearchParametersScreen(
}

Button(
enabled = uiState.searchEnabled,
modifier = Modifier
.fillMaxWidth()
.padding(16.dp, 8.dp, 16.dp, 8.dp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ data class SearchParametersUiState(
val items: List<FieldUiModel> = listOf(),
val minAttributesMessage: String? = null,
private val _shouldShowMinAttributeWarning: MutableSharedFlow<Boolean> = MutableSharedFlow(),
val searchEnabled: Boolean = false,
) {
val shouldShowMinAttributeWarning: SharedFlow<Boolean> = _shouldShowMinAttributeWarning

Expand Down

0 comments on commit 73ce7a7

Please sign in to comment.