From f0b67be017c47517116fa2707f915091e9a9cddc Mon Sep 17 00:00:00 2001 From: kaotisk Date: Thu, 24 Jul 2025 22:11:45 +0300 Subject: [fs] Now AKFS downloads are offered with their names --- src/js/utils.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/js/utils.js') diff --git a/src/js/utils.js b/src/js/utils.js index 6a355a8..a5f34dc 100644 --- a/src/js/utils.js +++ b/src/js/utils.js @@ -27,10 +27,10 @@ export function debugLog(message) if (showDebug) console.log(message); } -export function offerDownloadableData(data) +export function offerDownloadableData(data, filename) { var link = document.createElement('a'); - link.download = 'data'; + link.download = filename === undefined ? 'data': filename; var blob = new Blob([data]); // , {type: 'text/plain'} link.href = window.URL.createObjectURL(blob); link.click(); @@ -46,6 +46,6 @@ export function decodeBase64ToHex(base64String) { // Convert the byte array to a hex string representation return Array.from(byteArray) .map(byte => byte.toString(16).padStart(2, '0')) // Convert to hex and pad with zeros - .join(''); // Join with spaces for readability + .join(''); } // @license-end -- cgit v1.2.3