Skip to content

Commit

Permalink
feat: disable filter chips when there are no patches
Browse files Browse the repository at this point in the history
  • Loading branch information
CnC-Robert committed Jul 14, 2023
1 parent 955e7a4 commit 5d3b963
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,21 +162,24 @@ fun PatchesSelectorScreen(
horizontalArrangement = Arrangement.spacedBy(5.dp)
) {
FilterChip(
selected = vm.filter and SHOW_SUPPORTED != 0,
selected = vm.filter and SHOW_SUPPORTED != 0 && bundle.supported.isNotEmpty(),
onClick = { vm.toggleFlag(SHOW_SUPPORTED) },
label = { Text(stringResource(R.string.supported)) }
label = { Text(stringResource(R.string.supported)) },
enabled = bundle.supported.isNotEmpty()
)

FilterChip(
selected = vm.filter and SHOW_UNIVERSAL != 0,
selected = vm.filter and SHOW_UNIVERSAL != 0 && bundle.universal.isNotEmpty(),
onClick = { vm.toggleFlag(SHOW_UNIVERSAL) },
label = { Text(stringResource(R.string.universal)) }
label = { Text(stringResource(R.string.universal)) },
enabled = bundle.universal.isNotEmpty()
)

FilterChip(
selected = vm.filter and SHOW_UNSUPPORTED != 0,
selected = vm.filter and SHOW_UNSUPPORTED != 0 && bundle.unsupported.isNotEmpty(),
onClick = { vm.toggleFlag(SHOW_UNSUPPORTED) },
label = { Text(stringResource(R.string.unsupported)) }
label = { Text(stringResource(R.string.unsupported)) },
enabled = bundle.unsupported.isNotEmpty()
)
}

Expand Down

0 comments on commit 5d3b963

Please sign in to comment.