Handle updater download failures for retry UI

Co-authored-by: MasterAcnolo <68693319+MasterAcnolo@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-09-27 16:09:55 +00:00
committed by GitHub
parent c80d65483a
commit 9d09cf1b5d
3 changed files with 74 additions and 2 deletions

View File

@@ -45,13 +45,31 @@ async function initUpdateUI() {
return;
}
btn.onclick = () => {
window.electronAPI.downloadUpdate();
const initialButtonText = btn.textContent;
const initialIconText = icon.textContent;
const initialTitleText = title.textContent;
const initialSubText = sub.textContent;
btn.onclick = async () => {
btn.disabled = true;
btn.textContent = "Downloading...";
icon.textContent = "download";
title.textContent = "Downloading update";
progressWrap.style.display = "flex";
try {
await window.electronAPI.downloadUpdate();
} catch {
btn.disabled = false;
btn.textContent = initialButtonText;
icon.textContent = initialIconText;
title.textContent = initialTitleText;
sub.textContent = initialSubText;
progressWrap.style.display = "none";
progressFill.style.width = "0%";
progressPct.textContent = "0%";
progressEta.textContent = "";
}
};
window.electronAPI.onDownloadProgress((progress) => {