From 3251cfd0d1aa11926a31e2edb3adcadccb4edbe8 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 25 Jan 2024 09:47:54 +0000 Subject: [PATCH] Fixup. Format code with Prettier --- pod/main/static/js/main.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/pod/main/static/js/main.js b/pod/main/static/js/main.js index 7c212a59d8..12aa59a8f6 100644 --- a/pod/main/static/js/main.js +++ b/pod/main/static/js/main.js @@ -300,11 +300,13 @@ document.addEventListener("hidden.bs.collapse", (e) => { if (e.target.id === "qrcode") e.target.setAttribute("src", ""); }); -if(document.getElementById("btn-download-qr-code") !== null){ - document.getElementById("btn-download-qr-code").addEventListener('click', (e) => { - let nameOfDownload = e.target.dataset.slug + "-qrcode.png"; - downloadImage(document.getElementById('qrcode').src, nameOfDownload); - }); +if (document.getElementById("btn-download-qr-code") !== null) { + document + .getElementById("btn-download-qr-code") + .addEventListener("click", (e) => { + let nameOfDownload = e.target.dataset.slug + "-qrcode.png"; + downloadImage(document.getElementById("qrcode").src, nameOfDownload); + }); } /** @@ -314,15 +316,12 @@ if(document.getElementById("btn-download-qr-code") !== null){ * @param nameOfDownload Given name for download * @returns {Promise} */ -async function downloadImage( - imageSrc, - nameOfDownload = 'default.png', -) { +async function downloadImage(imageSrc, nameOfDownload = "default.png") { const response = await fetch(imageSrc); const blobImage = await response.blob(); const href = URL.createObjectURL(blobImage); - const anchorElement = document.createElement('a'); + const anchorElement = document.createElement("a"); anchorElement.href = href; anchorElement.download = nameOfDownload;