fix button selection

This commit is contained in:
Mylloon 2024-01-03 20:17:58 +01:00
parent 9cd7bd672b
commit 5f697980f7
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -122,6 +122,8 @@ fun HomeScreen(padding: PaddingValues, model: HomeViewModel = viewModel()) {
private fun DeleteRow( private fun DeleteRow(
context: Context, model: HomeViewModel context: Context, model: HomeViewModel
) { ) {
val selection by model.selected
Row( Row(
modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.Center modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.Center
) { ) {
@ -136,7 +138,7 @@ private fun DeleteRow(
Spacer(modifier = Modifier.padding(2.dp)) Spacer(modifier = Modifier.padding(2.dp))
Button(enabled = false, /*TODO: Activer uniquement quand on a qqch de sélectionner */ Button(enabled = selection != null,
onClick = { onClick = {
(model::doAction)(ActionHome.DELETION_SELECT) (model::doAction)(ActionHome.DELETION_SELECT)
}) { }) {