fix attachments download with already set url

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

@ -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<Props> {
public render() {
const { i18n, sessionResetMessageKey } = this.props;
const { sessionResetMessageKey } = this.props;
return (
<div className="module-reset-session-notification">
{i18n(sessionResetMessageKey)}
{window.i18n(sessionResetMessageKey)}
</div>
);
}

@ -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);
}
};

Loading…
Cancel
Save