mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Add polls "creator view" (#1765)
* Add end button in PollRoomTimelineView * Add creator logic * Refine PollRoomTimelineView previews * Add UI tests * Update preview tests
This commit is contained in:
+2
@@ -34,6 +34,8 @@ struct Poll: Equatable {
|
||||
let options: [Option]
|
||||
let votes: [String: [String]]
|
||||
let endDate: Date?
|
||||
/// Whether the poll has been created by the account owner
|
||||
let createdByAccountOwner: Bool
|
||||
|
||||
var hasEnded: Bool {
|
||||
endDate != nil
|
||||
|
||||
@@ -389,7 +389,8 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
|
||||
maxSelections: Int(maxSelections),
|
||||
options: options,
|
||||
votes: votes,
|
||||
endDate: endTime.map { Date(timeIntervalSince1970: TimeInterval($0 / 1000)) })
|
||||
endDate: endTime.map { Date(timeIntervalSince1970: TimeInterval($0 / 1000)) },
|
||||
createdByAccountOwner: eventItemProxy.sender.id == userID)
|
||||
|
||||
return PollRoomTimelineItem(id: eventItemProxy.id,
|
||||
poll: poll,
|
||||
|
||||
Reference in New Issue
Block a user