mirror of
https://github.com/documenso/documenso.git
synced 2025-11-10 12:32:34 +10:00
fix: incorrect download filename logic
This commit is contained in:
@ -15,12 +15,10 @@ export const downloadPDF = async ({ documentData, fileName }: DownloadPDFProps)
|
|||||||
type: 'application/pdf',
|
type: 'application/pdf',
|
||||||
});
|
});
|
||||||
|
|
||||||
const [baseTitle] = fileName?.includes('.pdf')
|
const baseTitle = (fileName ?? 'document').replace(/\.pdf$/, '');
|
||||||
? fileName.split('.pdf')
|
|
||||||
: [fileName ?? 'document'];
|
|
||||||
|
|
||||||
downloadFile({
|
downloadFile({
|
||||||
filename: baseTitle,
|
filename: `${baseTitle}.pdf`,
|
||||||
data: blob,
|
data: blob,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user