MESSENGER-4929 show participant votes button when user has voted

This commit is contained in:
JanNiklas Grabowski
2023-07-03 15:27:36 +02:00
parent 792420f657
commit 4b436752af
2 changed files with 5 additions and 2 deletions
@@ -100,6 +100,10 @@ struct TimelinePollDetails {
var representsPollEndedEvent: Bool {
eventType == .ended
}
var shouldShowShowParticipantsButton: Bool {
return (showParticipants && hasCurrentUserVoted && (type == TimelinePollType.disclosed || closed))
}
}
extension TimelinePollDetails: Identifiable { }
@@ -74,8 +74,7 @@ struct TimelinePollView: View {
.font(theme.fonts.footnote)
.foregroundColor(theme.colors.tertiaryContent)
if poll.showParticipants &&
(poll.type == TimelinePollType.disclosed || poll.closed) {
if poll.shouldShowShowParticipantsButton {
Button(action: {
viewModel.send(viewAction:.showParticipants)
})