fix: allow retry download from error state when update version is cached (#906)
This commit is contained in:
parent
2da6159a25
commit
700efc8f15
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue