fix: allow retry download from error state when update version is cached (#906)

This commit is contained in:
Jinjing 2026-04-21 14:31:18 -07:00 committed by GitHub
parent 2da6159a25
commit 700efc8f15
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 1 deletions

View File

@ -522,7 +522,17 @@ export function setupAutoUpdater(
}
export function downloadUpdate(): void {
if (currentStatus.state !== 'available' || downloadInFlight) {
if (downloadInFlight) {
return
}
// Why: permit retry from 'error' when we still have a cached availableVersion —
// a failed download leaves the status at 'error' but availableVersion intact,
// and the error card's "Retry Download" button must be able to restart the
// download. Without this, the button would appear to do nothing.
const canStart =
currentStatus.state === 'available' ||
(currentStatus.state === 'error' && hasNewerDownloadedVersion())
if (!canStart) {
return
}
downloadInFlight = true