Make composer duck aware of the conversation it is in

This commit is contained in:
Josh Perez 2023-01-04 19:22:36 -05:00 committed by GitHub
parent 7a076be0e7
commit 198d6f7e26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 449 additions and 170 deletions

View file

@ -38,7 +38,7 @@ export type PropsType = {
i18n: LocalizerType;
recordingState: RecordingState;
onSendAudioRecording: OnSendAudioRecordingType;
startRecording: () => unknown;
startRecording: (id: string) => unknown;
};
enum ToastType {
@ -96,7 +96,11 @@ export function AudioCapture({
useEscapeHandling(escapeRecording);
const startRecordingShortcut = useStartRecordingShortcut(startRecording);
const recordConversation = useCallback(
() => startRecording(conversationId),
[conversationId, startRecording]
);
const startRecordingShortcut = useStartRecordingShortcut(recordConversation);
useKeyboardShortcuts(startRecordingShortcut);
const closeToast = useCallback(() => {
@ -240,7 +244,7 @@ export function AudioCapture({
if (draftAttachments.length) {
setToastType(ToastType.VoiceNoteMustBeOnlyAttachment);
} else {
startRecording();
startRecording(conversationId);
}
}}
title={i18n('voiceRecording--start')}