From 7c47150194b1b381dcfe66881042fb50504b574c Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Tue, 27 Oct 2020 10:11:00 +1100 Subject: [PATCH] fix attachments download with already set url --- ts/components/conversation/ResetSessionNotification.tsx | 7 ++----- ts/types/Attachment.ts | 6 ++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/ts/components/conversation/ResetSessionNotification.tsx b/ts/components/conversation/ResetSessionNotification.tsx index 2d0394df3..044be000e 100644 --- a/ts/components/conversation/ResetSessionNotification.tsx +++ b/ts/components/conversation/ResetSessionNotification.tsx @@ -1,19 +1,16 @@ import React from 'react'; -import { LocalizerType } from '../../types/Util'; - interface Props { - i18n: LocalizerType; sessionResetMessageKey: string; } export class ResetSessionNotification extends React.Component { public render() { - const { i18n, sessionResetMessageKey } = this.props; + const { sessionResetMessageKey } = this.props; return (
- {i18n(sessionResetMessageKey)} + {window.i18n(sessionResetMessageKey)}
); } diff --git a/ts/types/Attachment.ts b/ts/types/Attachment.ts index a4fb4ffa0..c0d447fcf 100644 --- a/ts/types/Attachment.ts +++ b/ts/types/Attachment.ts @@ -327,7 +327,6 @@ export const save = ({ attachment, document, index, - getAbsolutePath, timestamp, }: { attachment: AttachmentType; @@ -337,11 +336,10 @@ export const save = ({ timestamp?: number; }): void => { const isObjectURLRequired = is.undefined(attachment.fileName); - const url = getAbsolutePath(attachment.fileName); const filename = getSuggestedFilename({ attachment, timestamp, index }); - saveURLAsFile({ url, filename, document }); + saveURLAsFile({ url: attachment.url, filename, document }); if (isObjectURLRequired) { - URL.revokeObjectURL(url); + URL.revokeObjectURL(attachment.url); } };