diff --git a/ts/components/CompositionArea.tsx b/ts/components/CompositionArea.tsx index 2a658b8bc8..8519744c14 100644 --- a/ts/components/CompositionArea.tsx +++ b/ts/components/CompositionArea.tsx @@ -11,10 +11,8 @@ import type { LocalizerType, ThemeType, } from '../types/Util'; -import type { - ErrorDialogAudioRecorderType, - RecordingState, -} from '../state/ducks/audioRecorder'; +import type { ErrorDialogAudioRecorderType } from '../state/ducks/audioRecorder'; +import { RecordingState } from '../state/ducks/audioRecorder'; import type { HandleAttachmentsProcessingArgsType } from '../util/handleAttachmentsProcessing'; import { Spinner } from './Spinner'; import type { Props as EmojiButtonProps } from './emoji/EmojiButton'; @@ -399,16 +397,18 @@ export const CompositionArea = ({ /> ) : null; - const attButton = linkPreviewResult ? undefined : ( -
-
- ); + const isRecording = recordingState === RecordingState.Recording; + const attButton = + linkPreviewResult || isRecording ? undefined : ( +
+
+ ); const sendButtonFragment = (
{ // TODO DESKTOP-2426 async processAttachments(files: Array): Promise { - if (this.preview) { + const state = window.reduxStore.getState(); + + const isRecording = + state.audioRecorder.recordingState === RecordingState.Recording; + + if (this.preview || isRecording) { return; }