push toast if gif size is too big

pull/1381/head
Audric Ackermann 4 years ago
parent da62ba6829
commit 9f14924e65
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -1093,7 +1093,7 @@ export class SessionConversation extends React.Component<Props, State> {
error && error.stack ? error.stack : error
);
ToastUtils.pushLoadAttachmentFailure();
ToastUtils.pushLoadAttachmentFailure(error?.message);
return;
}

@ -12,7 +12,7 @@ export async function downloadAttachment(attachment: any) {
serverUrl
);
let res: ArrayBuffer | null = null;
let res: ArrayBuffer | any = null;
// TODO: we need attachments to remember which API should be used to retrieve them
if (!defaultFileserver) {

@ -61,11 +61,18 @@ export function pushToastSuccess(
);
}
export function pushLoadAttachmentFailure() {
pushToastError(
'unableToLoadAttachment',
window.i18n('unableToLoadAttachment')
);
export function pushLoadAttachmentFailure(message?: string) {
if (message) {
pushToastError(
'unableToLoadAttachment',
`${window.i18n('unableToLoadAttachment')} ${message}`
);
} else {
pushToastError(
'unableToLoadAttachment',
window.i18n('unableToLoadAttachment')
);
}
}
export function pushDangerousFileError() {

Loading…
Cancel
Save