Merge branch 'main' into feat/passkey

This commit is contained in:
David Nguyen
2024-03-06 15:13:14 +08:00
committed by GitHub
8 changed files with 12 additions and 13 deletions

View File

@ -15,12 +15,10 @@ export const downloadPDF = async ({ documentData, fileName }: DownloadPDFProps)
type: 'application/pdf',
});
const [baseTitle] = fileName?.includes('.pdf')
? fileName.split('.pdf')
: [fileName ?? 'document'];
const baseTitle = (fileName ?? 'document').replace(/\.pdf$/, '');
downloadFile({
filename: baseTitle,
filename: `${baseTitle}.pdf`,
data: blob,
});
};