mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2024-09-30 08:50:44 +00:00
Use keys of map entries, as they are more reliable(from testing). Extract pollViewModel.pollOptions into a separate variable.
This commit is contained in:
parent
66317f5593
commit
6efb970794
@ -629,17 +629,21 @@ private fun BottomRowActions(postViewModel: NewPostViewModel) {
|
||||
|
||||
@Composable
|
||||
private fun PollField(postViewModel: NewPostViewModel) {
|
||||
val optionsList = postViewModel.pollOptions
|
||||
Column(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
) {
|
||||
postViewModel.pollOptions.values.forEachIndexed { index, _ ->
|
||||
NewPollOption(postViewModel, index)
|
||||
optionsList.forEach { value ->
|
||||
NewPollOption(postViewModel, value.key)
|
||||
}
|
||||
|
||||
NewPollVoteValueRange(postViewModel)
|
||||
|
||||
Button(
|
||||
onClick = { postViewModel.pollOptions[postViewModel.pollOptions.size] = "" },
|
||||
onClick = {
|
||||
// postViewModel.pollOptions[postViewModel.pollOptions.size] = ""
|
||||
optionsList[optionsList.size] = ""
|
||||
},
|
||||
border =
|
||||
BorderStroke(
|
||||
1.dp,
|
||||
|
Loading…
Reference in New Issue
Block a user