code review: try to remove not found keys from storage.local

This commit is contained in:
gorhill 2017-09-02 07:08:07 -04:00
parent a0c595d02d
commit 000d15d8ab
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 2 additions and 0 deletions

View File

@ -142,7 +142,9 @@ vAPI.cacheStorage = (function() {
if ( !db ) { return callback(); }
var transaction = db.transaction(STORAGE_NAME);
transaction.oncomplete = transaction.onerror = function() {
// TODO: remove once storage.local is clean
if ( notfoundKeys.size === 0 ) {
vAPI.storage.remove(keys);
return callback(store);
}
maybeMigrate(Array.from(notfoundKeys), store, callback);