fix voting on closed polls bug

This commit is contained in:
toadlyBroodle 2023-04-01 10:23:45 +09:00
parent 1f08f33600
commit 7e07573fa5
2 changed files with 3 additions and 3 deletions

View File

@ -131,7 +131,7 @@ fun ZapVote(
)
.show()
}
} else if (pollViewModel.isPollClosed) {
} else if (pollViewModel.isPollClosed()) {
scope.launch {
Toast
.makeText(

View File

@ -30,8 +30,8 @@ class PollNoteViewModel {
fun isVoteAmountAtomic() = valueMaximum != null && valueMinimum != null && valueMinimum == valueMaximum
val isPollClosed: Boolean = closedAt?.let { // allow 2 minute leeway for zap to propagate
pollNote?.createdAt()?.plus(it * (86400 + 120))!! > Date().time / 1000
fun isPollClosed(): Boolean = closedAt?.let { // allow 2 minute leeway for zap to propagate
pollNote?.createdAt()?.plus(it * (86400 + 120))!! < Date().time / 1000
} == true
fun voteAmountPlaceHolderText(sats: String): String = if (valueMinimum == null && valueMaximum == null) {