diff --git a/ts/components/session/conversation/SessionConversation.tsx b/ts/components/session/conversation/SessionConversation.tsx index 44244db5f..6ad0a46f3 100644 --- a/ts/components/session/conversation/SessionConversation.tsx +++ b/ts/components/session/conversation/SessionConversation.tsx @@ -1093,7 +1093,7 @@ export class SessionConversation extends React.Component { error && error.stack ? error.stack : error ); - ToastUtils.pushLoadAttachmentFailure(); + ToastUtils.pushLoadAttachmentFailure(error?.message); return; } diff --git a/ts/receiver/attachments.ts b/ts/receiver/attachments.ts index 756002b2e..7375ccf91 100644 --- a/ts/receiver/attachments.ts +++ b/ts/receiver/attachments.ts @@ -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) { diff --git a/ts/session/utils/Toast.tsx b/ts/session/utils/Toast.tsx index 89722397d..4ed2b89bd 100644 --- a/ts/session/utils/Toast.tsx +++ b/ts/session/utils/Toast.tsx @@ -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() {