From 78177aa03e0652876996325aa018dcdb4bd96de2 Mon Sep 17 00:00:00 2001 From: robbizbal Date: Wed, 13 Nov 2024 19:14:53 +0100 Subject: [PATCH] Hotfix mask_downloader.js cleanup was to early --- src/static/scripts/mask_downloader.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/static/scripts/mask_downloader.js b/src/static/scripts/mask_downloader.js index d365c91..f7d3ed2 100644 --- a/src/static/scripts/mask_downloader.js +++ b/src/static/scripts/mask_downloader.js @@ -15,13 +15,12 @@ document.getElementById('downloadBtn').addEventListener('click', function() { const linkNT = document.createElement('a'); linkNT.href = URL.createObjectURL(blobNewText); linkNT.download = 'yoyo-anonymizedText.txt'; // Specify the file name + + linkE.click(); + URL.revokeObjectURL(linkE.href); setTimeout(function() { - linkE.click(); + linkNT.click(); + URL.revokeObjectURL(linkNT.href) }, 50); - linkNT.click(); - - // Clean up and revoke the object URL - URL.revokeObjectURL(linkE.href); - URL.revokeObjectURL(linkNT.href) }); \ No newline at end of file