shouldUpload --> uploadToServer

This commit is contained in:
Samuel Attard 2016-11-22 19:30:20 +11:00 committed by Kevin Sawicki
parent a7dedb3a13
commit 2bf6f28152
11 changed files with 41 additions and 41 deletions

View file

@ -13,16 +13,16 @@ class CrashReporter {
options = {}
}
this.productName = options.productName != null ? options.productName : app.getName()
let {autoSubmit, companyName, extra, ignoreSystemCrashHandler, submitURL, shouldUpload} = options
let {autoSubmit, companyName, extra, ignoreSystemCrashHandler, submitURL, uploadToServer} = options
if (autoSubmit == null && shouldUpload == null) {
shouldUpload = true
if (autoSubmit == null && uploadToServer == null) {
uploadToServer = true
} else {
if (typeof autoSubmit !== 'undefined') {
// TODO: Remove depreceated property in 2.0.0
console.warn('The "autoSubmit" attribute on electron.crashReporter.start is depreceated. Please use "shouldUpload" instead.')
console.warn('The "autoSubmit" attribute on electron.crashReporter.start is depreceated. Please use "uploadToServer" instead.')
}
shouldUpload = shouldUpload || autoSubmit
uploadToServer = uploadToServer || autoSubmit
}
if (ignoreSystemCrashHandler == null) {
ignoreSystemCrashHandler = false
@ -62,7 +62,7 @@ class CrashReporter {
})
}
binding.start(this.getProductName(), companyName, submitURL, this.getCrashesDirectory(), shouldUpload, ignoreSystemCrashHandler, extra)
binding.start(this.getProductName(), companyName, submitURL, this.getCrashesDirectory(), uploadToServer, ignoreSystemCrashHandler, extra)
}
getLastCrashReport () {
@ -102,19 +102,19 @@ class CrashReporter {
return this.tempDirectory
}
getShouldUpload () {
getUploadToServer () {
if (process.type === 'browser') {
return binding._getShouldUpload()
return binding._getUploadToServer()
} else {
throw new Error('getShouldUpload can only be called from the main process')
throw new Error('getUploadToServer can only be called from the main process')
}
}
setShouldUpload (shouldUpload) {
setUploadToServer (uploadToServer) {
if (process.type === 'browser') {
return binding._setShouldUpload(shouldUpload)
return binding._setUploadToServer(uploadToServer)
} else {
throw new Error('setShouldUpload can only be called from the main process')
throw new Error('setUploadToServer can only be called from the main process')
}
}
}