mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 20:39:24 +00:00
Polls refinements (#1608)
* Refine focus behavior * Begin draft mode * Add alert on poll form * Add poll ended asset * Add fallback text for ended poll event * Cleanup * Fix assets * Remove poll feature flags * Fix UI tests * Fix ui tests * Refine discard poll alert * Remove unused import * Rename hasDraftContent -> hasContent * Restore createPoll-2 ref screenshots
This commit is contained in:
@@ -39,7 +39,15 @@ class CreatePollScreenViewModel: CreatePollScreenViewModelType, CreatePollScreen
|
||||
options: state.bindings.options.map(\.text),
|
||||
pollKind: state.bindings.isUndisclosed ? .undisclosed : .disclosed))
|
||||
case .cancel:
|
||||
actionsSubject.send(.cancel)
|
||||
if state.bindings.hasContent {
|
||||
state.bindings.alertInfo = .init(id: .init(),
|
||||
title: L10n.screenCreatePollDiscardConfirmationTitle,
|
||||
message: L10n.screenCreatePollDiscardConfirmation,
|
||||
primaryButton: .init(title: L10n.actionCancel, action: nil),
|
||||
secondaryButton: .init(title: L10n.actionOk, action: { self.actionsSubject.send(.cancel) }))
|
||||
} else {
|
||||
actionsSubject.send(.cancel)
|
||||
}
|
||||
case .deleteOption(let index):
|
||||
// fixes a crash that caused an index out of range when an option with the keyboard focus was deleted
|
||||
Task {
|
||||
|
||||
Reference in New Issue
Block a user