From b34e6da6ec22e0186d5b406cdb798a537c11ec8a Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sat, 6 Jun 2020 08:45:24 -0400 Subject: [PATCH] Split fetching settings/storage used in Settings pane Computing storage-used figures can take longer than usual sometimes when a lot of filter lists are enabled, and this can cause the Settings pane to take longer to be filled the first time it is opened. Fetching settings and storage-used figures separately removes that potential delay (they were fetched together in a single Promise.all() call). --- src/js/settings.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/js/settings.js b/src/js/settings.js index a9fa555dd..b33a54040 100644 --- a/src/js/settings.js +++ b/src/js/settings.js @@ -271,12 +271,12 @@ const onUserSettingsReceived = function(details) { /******************************************************************************/ -Promise.all([ - vAPI.messaging.send('dashboard', { what: 'userSettings' }), - vAPI.messaging.send('dashboard', { what: 'getLocalData' }), -]).then(results => { - onUserSettingsReceived(results[0]); - onLocalDataReceived(results[1]); +vAPI.messaging.send('dashboard', { what: 'userSettings' }).then(result => { + onUserSettingsReceived(result); +}); + +vAPI.messaging.send('dashboard', { what: 'getLocalData' }).then(result => { + onLocalDataReceived(result); }); // https://github.com/uBlockOrigin/uBlock-issues/issues/591