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) }) 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]) {
if (typeof resp[key] !== 'undefined' && obj[key] !== resp[key] && theResult) { confirmDialog((result) => {
console.log('Overwriting', key) if (result) {
filesProviders['browser'].set(key, resp[key]) console.log('Overwriting', key)
} else { filesProviders['browser'].set(key, resp[key])
console.log('add to obj', obj, key) }
filesProviders['browser'].get(key, (error, content) => { })
if (error) { } else {
console.log(error) console.log('add to obj', obj, key)
} else { filesProviders['browser'].get(key, (error, content) => {
obj[key] = content if (error) {
} console.log(error)
}) } else {
} obj[key] = content
}) }
})
}
done++ done++
if (done >= count) { if (done >= count) {

Loading…
Cancel
Save