ios: hide voice message button in chat console (#1442)

This commit is contained in:
JRoberts
2022-11-26 18:43:49 +04:00
committed by GitHub
parent 5619152810
commit 7e204127b8
2 changed files with 4 additions and 2 deletions

View File

@@ -12,6 +12,7 @@ import SimpleXChat
struct SendMessageView: View {
@Binding var composeState: ComposeState
var sendMessage: () -> Void
var showVoiceMessageButton: Bool = true
var voiceMessageAllowed: Bool = true
var showEnableVoiceMessagesAlert: ChatInfo.ShowEnableVoiceMessagesAlert = .other
var startVoiceMessageRecording: (() -> Void)? = nil
@@ -66,7 +67,8 @@ struct SendMessageView: View {
.padding([.bottom, .trailing], 3)
} else {
let vmrs = composeState.voiceMessageRecordingState
if composeState.message.isEmpty,
if showVoiceMessageButton,
composeState.message.isEmpty,
!composeState.editing,
(composeState.noPreview && vmrs == .noRecording)
|| (vmrs == .recording && holdingVMR) {

View File

@@ -86,7 +86,7 @@ struct TerminalView: View {
SendMessageView(
composeState: $composeState,
sendMessage: sendMessage,
voiceMessageAllowed: false,
showVoiceMessageButton: false,
keyboardVisible: $keyboardVisible
)
.padding(.horizontal, 12)