Skip to content

Commit

Permalink
Fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
Rawa committed Dec 23, 2024
1 parent db9b326 commit a220f59
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@ private fun LazyItemScope.RemovedProvider(
state: RelayFilterUiState,
onSelectedProvider: (checked: Boolean, providerId: ProviderId) -> Unit,
) {
val checked = providerId in state.selectedProviders
val checked =
state.selectedProviders is Constraint.Only && providerId in state.selectedProviders.value
CheckboxCell(
title = stringResource(R.string.removed_provider, providerId.value),
checked = checked,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ data class RelayFilterUiState(
}.sorted()

val isApplyButtonEnabled = selectedProviders.getOrNull()?.isNotEmpty() != false
val removedProviders: List<ProviderId> = selectedProviders - allProviders
val removedProviders: List<ProviderId> =
when (selectedProviders) {
Constraint.Any -> emptyList()
is Constraint.Only -> selectedProviders.value.toList() - allProviders
}

val isAllProvidersChecked = selectedProviders is Constraint.Any
}

0 comments on commit a220f59

Please sign in to comment.