Move Chrome sync to the files API

pull/1/head
Alex Beregszaszi 8 years ago
parent a1199b0ea8
commit a95ec855e4
  1. 8
      src/app.js

@ -123,11 +123,11 @@ var run = function () {
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 "' + 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 "' + 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)
storage.set(key, resp[key]) files.set(key, resp[key])
updateFiles() updateFiles()
} else { } else {
console.log('add to obj', obj, key) console.log('add to obj', obj, key)
obj[key] = storage.get(key) obj[key] = files.get(key)
} }
done++ done++
if (done >= count) { if (done >= count) {
@ -138,9 +138,9 @@ var run = function () {
}) })
} }
for (var y in storage.keys()) { for (var y in files.list()) {
console.log('checking', y) console.log('checking', y)
obj[y] = storage.get(y) obj[y] = files.get(y)
count++ count++
check(y) check(y)
} }

Loading…
Cancel
Save