From c19e1e2cf7597042d86125ecb710da177c8145ba Mon Sep 17 00:00:00 2001 From: alwaysmesmerizingyou Date: Tue, 1 Sep 2026 20:14:28 -0700 Subject: [PATCH] fixed downloading update ( sorry lmfao ) --- main.js | 6 +++++- ui/index.html | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index f037aeb..96a29cb 100644 --- a/main.js +++ b/main.js @@ -147,9 +147,13 @@ async function start() { debugLog(`Attempting to download update (Attempt ${attempts})...`); sendToTauri('status', { message: `Connecting to download servers (Attempt ${attempts}/3)...` }); + let lastPercent = -1; await updateClient.downloadUpdate(release, tempZipPath, (downloaded, total) => { const percent = total > 0 ? Math.round((downloaded / total) * 100) : 0; - sendToTauri('download-progress', { downloaded, total, percent }); + if (percent !== lastPercent) { + lastPercent = percent; + sendToTauri('download-progress', { downloaded, total, percent }); + } }); debugLog('Download complete. Verifying checksum...'); diff --git a/ui/index.html b/ui/index.html index 760354f..0b64513 100644 --- a/ui/index.html +++ b/ui/index.html @@ -544,7 +544,9 @@ void main() { if (progressTrack) progressTrack.style.display = "block"; const percent = data.percent || 0; if (progressFill) progressFill.style.width = percent + "%"; - setStatus(`Downloading update... ${percent}%`); + if (!currentStatusText.startsWith("Downloading update...")) { + setStatus("Downloading update..."); + } } });