Commit d0db134a authored by Alex Beregszaszi's avatar Alex Beregszaszi

Use window.localStorage in all cases

parent 79a30f6c
/* global chrome, confirm, localStorage */ /* global chrome, confirm */
var utils = require('./utils'); var utils = require('./utils');
...@@ -17,11 +17,11 @@ function StorageHandler (updateFiles) { ...@@ -17,11 +17,11 @@ function StorageHandler (updateFiles) {
console.log('comparing to cloud', key, resp); console.log('comparing to cloud', key, resp);
if (typeof resp[key] !== 'undefined' && obj[key] !== resp[key] && confirm('Overwrite "' + utils.fileNameFromKey(key) + '"? Click Ok to overwrite local file with file from cloud. Cancel will push your local file to the cloud.')) { if (typeof resp[key] !== 'undefined' && obj[key] !== resp[key] && confirm('Overwrite "' + utils.fileNameFromKey(key) + '"? Click Ok to overwrite local file with file from cloud. Cancel will push your local file to the cloud.')) {
console.log('Overwriting', key); console.log('Overwriting', key);
localStorage.setItem(key, resp[key]); window.localStorage.setItem(key, resp[key]);
updateFiles(); updateFiles();
} else { } else {
console.log('add to obj', obj, key); console.log('add to obj', obj, key);
obj[key] = localStorage[key]; obj[key] = window.localStorage[key];
} }
done++; done++;
if (done >= count) { if (done >= count) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment