Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Update frontend/src/pages/ReportsHistory.jsx
Browse files
frontend/src/pages/ReportsHistory.jsx
CHANGED
|
@@ -78,6 +78,7 @@ export const ReportsHistory = () => {
|
|
| 78 |
const blob = await res.blob();
|
| 79 |
const url = window.URL.createObjectURL(blob);
|
| 80 |
const a = document.createElement('a');
|
|
|
|
| 81 |
let filename = '';
|
| 82 |
const disposition = res.headers.get('Content-Disposition');
|
| 83 |
if (disposition && disposition.includes('filename=')) {
|
|
@@ -102,7 +103,7 @@ export const ReportsHistory = () => {
|
|
| 102 |
document.body.appendChild(a);
|
| 103 |
a.click();
|
| 104 |
a.remove();
|
| 105 |
-
window.URL.revokeObjectURL(url);
|
| 106 |
} else {
|
| 107 |
setError("Failed to compile PDF Report. Server error.");
|
| 108 |
}
|
|
|
|
| 78 |
const blob = await res.blob();
|
| 79 |
const url = window.URL.createObjectURL(blob);
|
| 80 |
const a = document.createElement('a');
|
| 81 |
+
a.href = url;
|
| 82 |
let filename = '';
|
| 83 |
const disposition = res.headers.get('Content-Disposition');
|
| 84 |
if (disposition && disposition.includes('filename=')) {
|
|
|
|
| 103 |
document.body.appendChild(a);
|
| 104 |
a.click();
|
| 105 |
a.remove();
|
| 106 |
+
setTimeout(() => window.URL.revokeObjectURL(url), 100);
|
| 107 |
} else {
|
| 108 |
setError("Failed to compile PDF Report. Server error.");
|
| 109 |
}
|