From 4f7523b8964c4aa42f59dedb44397fda82641e83 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Wed, 22 Nov 2023 00:58:06 +0200 Subject: [PATCH] Parallelize extensions auto-update + add a toast --- public/scripts/extensions.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/scripts/extensions.js b/public/scripts/extensions.js index 2c68b949a..36474c486 100644 --- a/public/scripts/extensions.js +++ b/public/scripts/extensions.js @@ -846,12 +846,15 @@ async function checkForExtensionUpdates(force) { } async function autoUpdateExtensions() { + toastr.info('Auto-updating extensions. This may take several minutes.', 'Please wait...', { timeOut: 10000, extendedTimeOut: 20000 }); + const promises = []; for (const [id, manifest] of Object.entries(manifests)) { if (manifest.auto_update && id.startsWith('third-party')) { console.debug(`Auto-updating 3rd-party extension: ${manifest.display_name} (${id})`); - await updateExtension(id.replace('third-party', ''), true); + promises.push(updateExtension(id.replace('third-party', ''), true)); } } + await Promise.allSettled(promises); } /**