focus composition box after adding an attachment

pull/1387/head
Audric Ackermann 5 years ago
parent 7a13717739
commit c5927cfc4b
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -530,6 +530,7 @@ export class SessionCompositionBox extends React.Component<Props, State> {
const objectUrl = URL.createObjectURL(file);
try {
const type = 'image/png';
const thumbnail = await VisualAttachment.makeVideoScreenshot({
objectUrl,
contentType: type,
@ -664,9 +665,12 @@ export class SessionCompositionBox extends React.Component<Props, State> {
if (attachment.isVoiceMessage && stagedAttachments.length > 0) {
throw new Error('A voice note cannot be sent with other attachments');
}
this.setState({
stagedAttachments: [...stagedAttachments, { ...attachment }],
});
this.setState(
{
stagedAttachments: [...stagedAttachments, { ...attachment }],
},
this.focusCompositionBox
);
}
private async autoScale<T extends { contentType: string; file: any }>(

@ -17,7 +17,6 @@ export function pushLoadAttachmentFailure() {
});
}
export function pushDangerousFileError() {
window.pushToast({
title: window.i18n('dangerousFileType'),

Loading…
Cancel
Save