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

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

Loading…
Cancel
Save