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).
This commit is contained in:
Raymond Hill 2020-06-06 08:45:24 -04:00
parent ec2670903b
commit b34e6da6ec
No known key found for this signature in database
GPG key ID: 25E1490B761470C2

View file

@ -271,12 +271,12 @@ const onUserSettingsReceived = function(details) {
/******************************************************************************/ /******************************************************************************/
Promise.all([ vAPI.messaging.send('dashboard', { what: 'userSettings' }).then(result => {
vAPI.messaging.send('dashboard', { what: 'userSettings' }), onUserSettingsReceived(result);
vAPI.messaging.send('dashboard', { what: 'getLocalData' }), });
]).then(results => {
onUserSettingsReceived(results[0]); vAPI.messaging.send('dashboard', { what: 'getLocalData' }).then(result => {
onLocalDataReceived(results[1]); onLocalDataReceived(result);
}); });
// https://github.com/uBlockOrigin/uBlock-issues/issues/591 // https://github.com/uBlockOrigin/uBlock-issues/issues/591