diff --git a/public/js/index.js b/public/js/index.js index e4dcb64..257f4d5 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -45,9 +45,8 @@ async function uploadFile(trackerUrl) { if (!response.ok) throw new Error("Failed to generate mnemonic"); const data = await response.json(); const uploadResult = document.getElementById("uploadResult"); - const downloadUrl = `${ - window.location.origin - }/${data.mnemonic.replaceAll(" ", ".")}`; + const downloadUrl = `${window.location.origin + }/${data.mnemonic.replaceAll(" ", ".")}`; history.pushState({}, "", `/${data.mnemonic.replaceAll(" ", ".")}`); uploadResult.innerHTML = `Seeding file. Share this mnemonic: ${data.mnemonic}
Note that the file will be available for download only as long as you keep this page open.`; @@ -168,27 +167,26 @@ async function downloadFile(trackerUrl) { downloadResult.innerHTML = `Downloading: ${torrent.files[0].name}
-
Status: ${ - torrent.done ? "Completed, seeding" : "Downloading" - } +
Status: ${torrent.done ? "Completed, seeding" : "Downloading" + }
Peers: ${torrent.numPeers}

Downloaded: ${( - torrent.downloaded / - (1024 * 1024) - ).toFixed(2)} MB / ${(torrent.length / (1024 * 1024)).toFixed( - 2 - )} MB (${progress}%) + torrent.downloaded / + (1024 * 1024) + ).toFixed(2)} MB / ${(torrent.length / (1024 * 1024)).toFixed( + 2 + )} MB (${progress}%)
Speed: ${( - torrent.downloadSpeed / - (1024 * 1024) - ).toFixed(2)} MB/s -
ETA: ${torrent.timeRemaining} seconds + torrent.downloadSpeed / + (1024 * 1024) + ).toFixed(2)} MB/s +
ETA: ${(torrent.timeRemaining / 1000).toFixed(0)} seconds

Uploaded: ${( - torrent.uploaded / - (1024 * 1024) - ).toFixed(2)} MB + torrent.uploaded / + (1024 * 1024) + ).toFixed(2)} MB
Ratio: ${torrent.ratio.toFixed(2)}`; return; }