Fix regression in selfie destruction code

Related commit:
- 915687fddb (diff-73ef8c4664f2ec8c02320d50b2908efdR1100-R1113)

Since selfie destruction is now deferred so as to
coallesce burst of call to destroy(), the selfie
load code must mind whether there is a pending
destruction in order to decide whether the
selfie can be safely loaded.

Related feedback:
- 23c4c80136 (commitcomment-35179834)
This commit is contained in:
Raymond Hill 2019-09-21 19:24:47 -04:00
parent 3bdad19d6e
commit eb871ae558
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
2 changed files with 6 additions and 2 deletions

View File

@ -140,8 +140,8 @@ const µBlock = (( ) => { // jshint ignore:line
// Read-only // Read-only
systemSettings: { systemSettings: {
compiledMagic: 19, // Increase when compiled format changes compiledMagic: 20, // Increase when compiled format changes
selfieMagic: 19, // Increase when selfie format changes selfieMagic: 20, // Increase when selfie format changes
}, },
restoreBackupSettings: { restoreBackupSettings: {

View File

@ -1052,6 +1052,10 @@
}; };
const load = async function() { const load = async function() {
if ( destroyTimer !== undefined ) {
return Promise.resolve(false);
}
return Promise.all([ return Promise.all([
µb.assets.get('selfie/main').then(details => { µb.assets.get('selfie/main').then(details => {
if ( if (