Skip to content
Snippets Groups Projects
Unverified Commit 703af95e authored by gabriellsh's avatar gabriellsh Committed by GitHub
Browse files

fix: Attachments not downloading on non-encrypted rooms (#32837)

parent 88e5219b
No related branches found
No related tags found
No related merge requests found
---
"@rocket.chat/meteor": patch
---
Fixed an issue where non-encrypted attachments were not being downloaded
......@@ -38,15 +38,21 @@ const GenericFileAttachment = ({
const { t } = useTranslation();
const handleTitleClick = (event: UIEvent): void => {
if (openDocumentViewer && link) {
if (!link) {
return;
}
if (openDocumentViewer && format === 'PDF') {
event.preventDefault();
if (format === 'PDF') {
const url = new URL(getURL(link), window.location.origin);
url.searchParams.set('contentDisposition', 'inline');
openDocumentViewer(url.toString(), format, '');
return;
}
const url = new URL(getURL(link), window.location.origin);
url.searchParams.set('contentDisposition', 'inline');
openDocumentViewer(url.toString(), format, '');
return;
}
if (link.includes('/file-decrypt/')) {
event.preventDefault();
registerDownloadForUid(uid, t, title);
forAttachmentDownload(uid, link);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment