mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-23 01:52:44 +02:00
Show decryption error on TimelinePollView
This commit is contained in:
@@ -152,7 +152,8 @@ struct TimelinePollAnswerOptionButton_Previews: PreviewProvider {
|
||||
totalAnswerCount: 100,
|
||||
type: type,
|
||||
maxAllowedSelections: 1,
|
||||
hasBeenEdited: false)
|
||||
hasBeenEdited: false,
|
||||
hasDecryptionError: false)
|
||||
}
|
||||
|
||||
static func buildAnswerOption(text: String = "Test", selected: Bool, winner: Bool = false) -> TimelinePollAnswerOption {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user