Skip to content

Commit c43d880

Browse files
Merge pull request #126 from NessieCanCode/fdgfjp-fix-pdf-export-not-returning-results
Display invoice export errors in UI
2 parents 1a916ec + 3a6f49a commit c43d880

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/slurmcostmanager.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,10 @@ function Details({
852852
const a = document.createElement('a');
853853
a.href = url;
854854
a.download = 'details.csv';
855+
// Append link to DOM so browsers will download the file
856+
document.body.appendChild(a);
855857
a.click();
858+
document.body.removeChild(a);
856859
URL.revokeObjectURL(url);
857860
}
858861

@@ -918,7 +921,10 @@ function Details({
918921
const a = document.createElement('a');
919922
a.href = url;
920923
a.download = 'recharge_invoice.pdf';
924+
// Append link to DOM so browsers will download the file
925+
document.body.appendChild(a);
921926
a.click();
927+
document.body.removeChild(a);
922928
URL.revokeObjectURL(url);
923929
} catch (e) {
924930
console.error(e);

0 commit comments

Comments
 (0)