fixed downloading update ( sorry lmfao )

This commit is contained in:
2026-09-01 20:14:28 -07:00
parent 6b06bc8170
commit c19e1e2cf7
2 changed files with 8 additions and 2 deletions

View File

@@ -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...');

View File

@@ -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...");
}
}
});