don't confirm if not needed

pull/1/head
yann300 7 years ago
parent c8ed134f7d
commit 69aea682b5
  1. 32
      src/app/files/chromeCloudStorageSync.js

@ -19,21 +19,23 @@ module.exports = function (filesProviders) {
modalDialogCustom.confirm('', 'Overwrite "' + key + '"? Click Ok to overwrite local file with file from cloud. Cancel will push your local file to the cloud.', () => { callback(true) }, () => { callback(false) })
}
confirmDialog(function (theResult) {
if (typeof resp[key] !== 'undefined' && obj[key] !== resp[key] && theResult) {
console.log('Overwriting', key)
filesProviders['browser'].set(key, resp[key])
} else {
console.log('add to obj', obj, key)
filesProviders['browser'].get(key, (error, content) => {
if (error) {
console.log(error)
} else {
obj[key] = content
}
})
}
})
if (typeof resp[key] !== 'undefined' && obj[key] !== resp[key]) {
confirmDialog((result) => {
if (result) {
console.log('Overwriting', key)
filesProviders['browser'].set(key, resp[key])
}
})
} else {
console.log('add to obj', obj, key)
filesProviders['browser'].get(key, (error, content) => {
if (error) {
console.log(error)
} else {
obj[key] = content
}
})
}
done++
if (done >= count) {

Loading…
Cancel
Save