mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-27 23:36:21 +02:00
show amount for atomic polls before zapping
This commit is contained in:
@@ -150,27 +150,7 @@ fun ZapVote(
|
|||||||
.show()
|
.show()
|
||||||
}
|
}
|
||||||
return@combinedClickable
|
return@combinedClickable
|
||||||
}
|
} else { wantsToZap = true }
|
||||||
accountViewModel.zap(
|
|
||||||
baseNote,
|
|
||||||
pollViewModel.valueMaximum!!.toLong() * 1000,
|
|
||||||
pollOption,
|
|
||||||
"",
|
|
||||||
context,
|
|
||||||
onError = {
|
|
||||||
scope.launch {
|
|
||||||
zappingProgress = 0f
|
|
||||||
Toast
|
|
||||||
.makeText(context, it, Toast.LENGTH_SHORT)
|
|
||||||
.show()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onProgress = {
|
|
||||||
scope.launch(Dispatchers.Main) {
|
|
||||||
zappingProgress = it
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
} else {
|
} else {
|
||||||
wantsToZap = true
|
wantsToZap = true
|
||||||
}
|
}
|
||||||
@@ -266,8 +246,10 @@ fun ZapVoteAmountChoicePopup(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(10.dp)
|
.padding(10.dp)
|
||||||
) {
|
) {
|
||||||
val amount = pollViewModel.inputVoteAmountLong(inputAmountText)
|
var amount = pollViewModel.inputVoteAmountLong(inputAmountText)
|
||||||
|
|
||||||
|
// only prompt for input amount if vote is not atomic
|
||||||
|
if (!pollViewModel.isVoteAmountAtomic()) {
|
||||||
OutlinedTextField(
|
OutlinedTextField(
|
||||||
value = inputAmountText,
|
value = inputAmountText,
|
||||||
onValueChange = { inputAmountText = it },
|
onValueChange = { inputAmountText = it },
|
||||||
@@ -287,6 +269,7 @@ fun ZapVoteAmountChoicePopup(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
} else { amount = pollViewModel.valueMaximum?.toLong() }
|
||||||
|
|
||||||
val isValidInputAmount = pollViewModel.isValidInputVoteAmount(amount)
|
val isValidInputAmount = pollViewModel.isValidInputVoteAmount(amount)
|
||||||
Button(
|
Button(
|
||||||
|
Reference in New Issue
Block a user