Revert "Keep settings from storage.sync as we move back to storage.local"

This reverts commit 14505f88e7.
This commit is contained in:
codebicycle
2017-11-10 21:07:13 +02:00
parent b5276a0ced
commit eb2f52a675

View File

@@ -25,22 +25,6 @@ chrome.runtime.sendMessage({}, function(response) {
} }
}; };
// Keep settings from storage.sync as we transition back to storage.local.
// Copy settings from chrome.storage.sync to chrome.storage.local
// and clear the contents of chrome.storage.sync.
chrome.storage.sync.get(null, function(storage){
function is_empty(obj) {
return Object.keys(obj).length === 0 && obj.constructor === Object
}
if (!chrome.runtime.lastError) {
if(storage && !is_empty(storage)) {
chrome.storage.local.set(storage);
chrome.storage.sync.clear();
}
}
});
chrome.storage.local.get(tc.settings, function(storage) { chrome.storage.local.get(tc.settings, function(storage) {
tc.settings.speed = Number(storage.speed); tc.settings.speed = Number(storage.speed);
tc.settings.resetSpeed = Number(storage.resetSpeed); tc.settings.resetSpeed = Number(storage.resetSpeed);