mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-10 09:07:54 +01:00
code review re. #3006
This commit is contained in:
parent
6a71fc59a4
commit
4865561ca4
1 changed files with 10 additions and 2 deletions
|
@ -1206,7 +1206,9 @@ vAPI.cloud = (function() {
|
|||
for ( var i = start; i < n; i++ ) {
|
||||
keys.push(dataKey + i.toString());
|
||||
}
|
||||
chrome.storage.sync.remove(keys);
|
||||
if ( keys.length !== 0 ) {
|
||||
chrome.storage.sync.remove(keys);
|
||||
}
|
||||
};
|
||||
|
||||
var start = function(/* dataKeys */) {
|
||||
|
@ -1242,7 +1244,13 @@ vAPI.cloud = (function() {
|
|||
errorStr = chrome.runtime.lastError.message;
|
||||
// https://github.com/gorhill/uBlock/issues/3006#issuecomment-332597677
|
||||
// - Delete all that was pushed in case of failure.
|
||||
chunkCount = 0;
|
||||
// - It's unknown whether such issue applies only to Firefox:
|
||||
// until such cases are reported for other browsers, we will
|
||||
// reset the (now corrupted) content of the cloud storage
|
||||
// only on Firefox.
|
||||
if ( vAPI.webextFlavor.startsWith('Mozilla-Firefox-') ) {
|
||||
chunkCount = 0;
|
||||
}
|
||||
}
|
||||
callback(errorStr);
|
||||
|
||||
|
|
Loading…
Reference in a new issue