mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +01:00
fix to show vote results if only "poll.votes" are available
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
d31a9b1ade
commit
0388f3e3f6
@ -115,7 +115,10 @@ class PollResultsFragment(
|
|||||||
val oneVoteInPercent = 100 / votersAmount
|
val oneVoteInPercent = 100 / votersAmount
|
||||||
|
|
||||||
poll.options?.forEachIndexed { index, option ->
|
poll.options?.forEachIndexed { index, option ->
|
||||||
val votersForThisOption = poll.votes?.filter { it.key.toInt() == index }?.size!!
|
var votersForThisOption = poll.votes.filter { it.key.toInt() == index }[index.toString()]
|
||||||
|
if (votersForThisOption == null) {
|
||||||
|
votersForThisOption = 0
|
||||||
|
}
|
||||||
val optionsPercent = oneVoteInPercent * votersForThisOption
|
val optionsPercent = oneVoteInPercent * votersForThisOption
|
||||||
|
|
||||||
val pollResultItem = PollResultItem(option, optionsPercent)
|
val pollResultItem = PollResultItem(option, optionsPercent)
|
||||||
|
Loading…
Reference in New Issue
Block a user