mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Group together voice message and poll actions (#2054)
* Group together voice message and poll actions * Extract nested switches into separate methods
This commit is contained in:
@@ -66,7 +66,7 @@ struct PollRoomTimelineView: View {
|
||||
ForEach(poll.options, id: \.id) { option in
|
||||
Button {
|
||||
guard let eventID, !option.isSelected else { return }
|
||||
context.send(viewAction: .selectedPollOption(pollStartID: eventID, optionID: option.id))
|
||||
context.send(viewAction: .poll(.selectOption(pollStartID: eventID, optionID: option.id)))
|
||||
feedbackGenerator.impactOccurred()
|
||||
} label: {
|
||||
PollOptionView(pollOption: option,
|
||||
@@ -93,7 +93,7 @@ struct PollRoomTimelineView: View {
|
||||
private var toolbarView: some View {
|
||||
if !poll.hasEnded, poll.createdByAccountOwner, let eventID {
|
||||
Button {
|
||||
context.send(viewAction: .endPoll(pollStartID: eventID))
|
||||
context.send(viewAction: .poll(.end(pollStartID: eventID)))
|
||||
} label: {
|
||||
Text(L10n.actionEndPoll)
|
||||
.lineLimit(2, reservesSpace: false)
|
||||
|
||||
Reference in New Issue
Block a user