Update prompt: ask after at most 45 s instead of waiting up to 8 min for the background download

This commit is contained in:
Jonathan Sykes
2026-10-15 11:42:07 +08:00
parent 59871a5b88
commit 41004bf14d

View File

@@ -8819,9 +8819,10 @@ async function maybeShowUpdateBanner() {
prefetchUpdate(); prefetchUpdate();
// Ask only once the new build is fully on disk, so "Refresh UI" is an // Ask only once the new build is fully on disk, so "Refresh UI" is an
// instant swap. Until then keep downloading quietly and re-check; if the // instant swap. Until then keep downloading quietly and re-check; if the
// download never completes (8 min) ask anyway — Refresh UI then downloads. // download hasn't completed within 45 s, ask anyway (Update now then
// downloads): on a slow link a longer wait looked like no update at all.
_updateSeenAt = _updateSeenAt || Date.now(); _updateSeenAt = _updateSeenAt || Date.now();
if (!(await updateDownloaded()) && Date.now() - _updateSeenAt < 8 * 60 * 1000) { if (!(await updateDownloaded()) && Date.now() - _updateSeenAt < 45 * 1000) {
setTimeout(maybeShowUpdateBanner, 15000); setTimeout(maybeShowUpdateBanner, 15000);
return; return;
} }