Show decryption error on TimelinePollView

This commit is contained in:
Alfonso Grillo
2022-12-23 12:08:25 +01:00
parent c946009c24
commit 359f44cb30
6 changed files with 19 additions and 3 deletions
@@ -49,6 +49,7 @@ struct TimelinePollView: View {
.fixedSize(horizontal: false, vertical: true)
Text(totalVotesString)
.lineLimit(2)
.font(theme.fonts.footnote)
.foregroundColor(theme.colors.tertiaryContent)
}
@@ -62,6 +63,10 @@ struct TimelinePollView: View {
private var totalVotesString: String {
let poll = viewModel.viewState.poll
if poll.hasDecryptionError, poll.totalAnswerCount > 0 {
return VectorL10n.pollTimelineDecryptionError
}
if poll.closed {
if poll.totalAnswerCount == 1 {
return VectorL10n.pollTimelineTotalFinalResultsOneVote