mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-24 18:42:47 +02:00
Customize TimePollView for poll.end events
This commit is contained in:
@@ -32,6 +32,11 @@ enum TimelinePollType {
|
||||
case undisclosed
|
||||
}
|
||||
|
||||
enum TimelinePollEventType {
|
||||
case started
|
||||
case ended
|
||||
}
|
||||
|
||||
struct TimelinePollAnswerOption: Identifiable {
|
||||
var id: String
|
||||
var text: String
|
||||
@@ -62,6 +67,7 @@ struct TimelinePollDetails {
|
||||
var closed: Bool
|
||||
var totalAnswerCount: UInt
|
||||
var type: TimelinePollType
|
||||
var eventType: TimelinePollEventType
|
||||
var maxAllowedSelections: UInt
|
||||
var hasBeenEdited = true
|
||||
var hasDecryptionError: Bool
|
||||
@@ -70,6 +76,7 @@ struct TimelinePollDetails {
|
||||
closed: Bool,
|
||||
totalAnswerCount: UInt,
|
||||
type: TimelinePollType,
|
||||
eventType: TimelinePollEventType,
|
||||
maxAllowedSelections: UInt,
|
||||
hasBeenEdited: Bool,
|
||||
hasDecryptionError: Bool) {
|
||||
@@ -78,6 +85,7 @@ struct TimelinePollDetails {
|
||||
self.closed = closed
|
||||
self.totalAnswerCount = totalAnswerCount
|
||||
self.type = type
|
||||
self.eventType = eventType
|
||||
self.maxAllowedSelections = maxAllowedSelections
|
||||
self.hasBeenEdited = hasBeenEdited
|
||||
self.hasDecryptionError = hasDecryptionError
|
||||
@@ -94,6 +102,10 @@ struct TimelinePollDetails {
|
||||
return type == .disclosed && totalAnswerCount > 0 && hasCurrentUserVoted
|
||||
}
|
||||
}
|
||||
|
||||
var representsPollEndedEvent: Bool {
|
||||
eventType == .ended
|
||||
}
|
||||
}
|
||||
|
||||
struct TimelinePollViewState: BindableState {
|
||||
|
||||
Reference in New Issue
Block a user