mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-19 08:03:50 +02:00
vector-im/element-ios/issues/5114 - Added UI for creating undisclosed polls and logic for displaying them in the timeline.
This commit is contained in:
committed by
Stefan Ceriu
parent
3e3719d13a
commit
eff1d8c81c
@@ -53,7 +53,8 @@ class PollEditFormViewModel: PollEditFormViewModelType {
|
||||
mode: parameters.mode,
|
||||
bindings: PollEditFormViewStateBindings(
|
||||
question: PollEditFormQuestion(text: parameters.pollDetails.question, maxLength: Constants.maxQuestionLength),
|
||||
answerOptions: parameters.pollDetails.answerOptions.map { PollEditFormAnswerOption(text: $0, maxLength: Constants.maxAnswerOptionLength) }
|
||||
answerOptions: parameters.pollDetails.answerOptions.map { PollEditFormAnswerOption(text: $0, maxLength: Constants.maxAnswerOptionLength) },
|
||||
type: parameters.pollDetails.type
|
||||
)
|
||||
)
|
||||
|
||||
@@ -111,7 +112,8 @@ class PollEditFormViewModel: PollEditFormViewModelType {
|
||||
// MARK: - Private
|
||||
|
||||
private func buildPollDetails() -> PollDetails {
|
||||
return PollDetails(question: state.bindings.question.text.trimmingCharacters(in: .whitespacesAndNewlines),
|
||||
return PollDetails(type: state.bindings.type,
|
||||
question: state.bindings.question.text.trimmingCharacters(in: .whitespacesAndNewlines),
|
||||
answerOptions: state.bindings.answerOptions.compactMap({ answerOption in
|
||||
let text = answerOption.text.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
return text.isEmpty ? nil : text
|
||||
|
||||
Reference in New Issue
Block a user