mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-06 04:18:31 +00:00
Warn and block sending on verification violation (#3679)
* feat(crypto): Warn and block sending on verification violation * fixup: Fix ComposerToolbar previews * fixup! add ComposerToolBarViewModelTests for canSend * add new preview tests for verification violations * Use `deferFulfillment`s in the unit tests. --------- Co-authored-by: Stefan Ceriu <stefanc@matrix.org>
This commit is contained in:
@@ -66,6 +66,8 @@ enum ComposerAttachmentType {
|
||||
struct ComposerToolbarViewState: BindableState {
|
||||
var composerMode: ComposerMode = .default
|
||||
var composerEmpty = true
|
||||
/// Could be false if sending is disabled in the room
|
||||
var canSend = true
|
||||
var suggestions: [SuggestionItem] = []
|
||||
var audioPlayerState: AudioPlayerState
|
||||
var audioRecorderState: AudioRecorderState
|
||||
@@ -97,6 +99,10 @@ struct ComposerToolbarViewState: BindableState {
|
||||
}
|
||||
|
||||
var sendButtonDisabled: Bool {
|
||||
if !canSend {
|
||||
return true
|
||||
}
|
||||
|
||||
if case .previewVoiceMessage = composerMode {
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user