diff --git a/frontend/src/hooks/useFileExport.ts b/frontend/src/hooks/useFileExport.ts index 349b4272..3cc4c781 100644 --- a/frontend/src/hooks/useFileExport.ts +++ b/frontend/src/hooks/useFileExport.ts @@ -42,8 +42,7 @@ export const useFileExport = (): UseFileExportReturn => { }); const contentDisposition = response.headers["content-disposition"]; - const fileNameMatch = - contentDisposition && contentDisposition.match(/filename="?(.+)"?\s*$/i); + const fileNameMatch = contentDisposition?.match(/filename="?(.+)"?\s*$/i); const fileName = fileNameMatch ? fileNameMatch[1] : `${documentName}.${exportType}`; const blob = new Blob([response.data], { type: response.headers["content-type"] });