Resume offline preparation on launch and show cache readiness
This commit is contained in:
@@ -8690,11 +8690,11 @@ async function applyUpdate(target, { quiet = false } = {}) {
|
||||
// When the waiting worker already downloaded this build in the
|
||||
// background, the toast says so and nothing is re-downloaded.
|
||||
askStatus: (worker) => SU.askCacheStatus(worker, { timeoutMs: 4000, setTimeout: (fn, ms) => setTimeout(fn, ms) }),
|
||||
onPhase: (phase) => {
|
||||
onPhase: (phase, status) => {
|
||||
if (quiet) return;
|
||||
if (_updateToast) _updateToast.remove();
|
||||
_updateToast = phase === 'ready'
|
||||
? toast('Applying the update…', { duration: 20000 })
|
||||
? toast(status?.offlineReady === false ? `Applying the update… Offline cache is still preparing (${status.cached}/${status.total}).` : 'Applying the update…', { duration: 20000 })
|
||||
: toast('Downloading the update…', { duration: 305000 });
|
||||
},
|
||||
refreshShell: ('caches' in window) ? () => SU.refreshShellInPlace({
|
||||
|
||||
Reference in New Issue
Block a user