Make composer duck aware of the conversation it is in
This commit is contained in:
parent
7a076be0e7
commit
198d6f7e26
17 changed files with 449 additions and 170 deletions
|
@ -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')}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue