mirror of
https://github.com/lumaa-dev/BubbleApp.git
synced 2025-01-29 01:39:16 +01:00
Fix vote count crash
This commit is contained in:
parent
8857da5ad0
commit
0beb5fac87
@ -21,7 +21,7 @@ struct PostPoll: View {
|
||||
let index = poll.options.firstIndex(where: { $0.id == option.id })
|
||||
let isMostVoted: Bool = self.isMostVoted(option: option)
|
||||
|
||||
let clamped: Double = Double(option.votesCount ?? 0) / Double(poll.safeVotersCount)
|
||||
let clamped: Double = Double(option.votesCount ?? 0) / max(Double(poll.safeVotersCount), 1.0)
|
||||
|
||||
Button {
|
||||
if !submitted && !poll.expired {
|
||||
|
Loading…
x
Reference in New Issue
Block a user