feat(ui): update URL without reloading after file upload

Added pushState to update the URL with the mnemonic after file upload, enhancing user experience by reflecting the unique file link in the address bar without reloading the page. This helps in easier sharing and bookmarking of the link.
This commit is contained in:
Kumi 2024-06-15 15:24:14 +02:00
parent 667b2bd199
commit 91c3e4b547
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -41,6 +41,7 @@ async function uploadFile() {
const downloadUrl = `${
window.location.origin
}/${data.mnemonic.replaceAll(" ", ".")}`;
history.pushState({}, "", `/${data.mnemonic.replaceAll(" ", ".")}`);
uploadResult.innerHTML = `Seeding file. Share this mnemonic: <strong>${data.mnemonic}</strong>
<br>Note that the file will be available for download only as long as you keep this page open.`;
copyButton.style.display = "inline-block";