mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Fixed an issue where the voice recording could break the input view
This commit is contained in:
parent
2f8ac7deaf
commit
275314c9fd
|
@ -404,8 +404,11 @@ final class InputView: UIView, InputViewButtonDelegate, InputTextViewDelegate, M
|
|||
func handleInputViewButtonLongPressBegan(_ inputViewButton: InputViewButton?) {
|
||||
guard inputViewButton == voiceMessageButton else { return }
|
||||
|
||||
delegate?.startVoiceMessageRecording()
|
||||
// Note: The 'showVoiceMessageUI' call MUST come before triggering 'startVoiceMessageRecording'
|
||||
// because if something goes wrong it'll trigger `hideVoiceMessageUI` and we don't want it to
|
||||
// end up in a state with the input content hidden
|
||||
showVoiceMessageUI()
|
||||
delegate?.startVoiceMessageRecording()
|
||||
}
|
||||
|
||||
func handleInputViewButtonLongPressMoved(_ inputViewButton: InputViewButton, with touch: UITouch?) {
|
||||
|
@ -466,9 +469,9 @@ final class InputView: UIView, InputViewButtonDelegate, InputTextViewDelegate, M
|
|||
UIView.animate(withDuration: 0.25, animations: {
|
||||
allOtherViews.forEach { $0.alpha = 1 }
|
||||
self.voiceMessageRecordingView?.alpha = 0
|
||||
}, completion: { _ in
|
||||
self.voiceMessageRecordingView?.removeFromSuperview()
|
||||
self.voiceMessageRecordingView = nil
|
||||
}, completion: { [weak self] _ in
|
||||
self?.voiceMessageRecordingView?.removeFromSuperview()
|
||||
self?.voiceMessageRecordingView = nil
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue