From 9ca0bb8f0c851a43b7869d1fefdd67f47c42d862 Mon Sep 17 00:00:00 2001 From: Monireh Rasouli <83644557+MonireRasouli@users.noreply.github.com> Date: Mon, 25 Nov 2024 11:36:23 +0000 Subject: [PATCH] ERM-3431, License Export as CSV does not result in file download (#710) * ERM-3431, License Export as CSV does not result in file download * tweak --- lib/utils/downloadBlob.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/utils/downloadBlob.js b/lib/utils/downloadBlob.js index a9e0638b..0c5f9ceb 100644 --- a/lib/utils/downloadBlob.js +++ b/lib/utils/downloadBlob.js @@ -28,13 +28,12 @@ const downloadBlob = ( } return blob => { - const url = window.URL.createObjectURL(blob); + const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = downloadName; - document.body.appendChild(a); a.click(); - a.remove(); + URL.revokeObjectURL(url); }; };