diff --git a/src/components/GenerateProjectPandLReport/GenerateProjectPandLReport.tsx b/src/components/GenerateProjectPandLReport/GenerateProjectPandLReport.tsx index f57c222..3f89165 100644 --- a/src/components/GenerateProjectPandLReport/GenerateProjectPandLReport.tsx +++ b/src/components/GenerateProjectPandLReport/GenerateProjectPandLReport.tsx @@ -56,8 +56,16 @@ const GenerateProjectPandLReport: React.FC & SubComponents = ({ projects if (Boolean(query.project) && query.project !== "All") { if(query.project != null && query.startMonth != "" && query.startMonthTo != undefined){ const response = await fetchProjectPandLReport({ projectId: parseFloat(query.project), startMonth: query.startMonth, endMonth: query.startMonthTo }) - if (response) { - downloadFile(new Uint8Array(response.blobValue), response.filename!!) + try{ + if (response) { + downloadFile(new Uint8Array(response.blobValue), response.filename!!) + } + }catch(error){ + errorDialogWithContent(t("Download Fail"), + t(`Please try it later`), t) + .then(() => { + window.location.reload() + }) } }else{ errorDialogWithContent(t("Download Fail"),