Use GetUploadsEnabled to return GetShouldUpload

This commit is contained in:
Samuel Attard 2016-11-08 13:39:11 +13:00 committed by Kevin Sawicki
parent 5a1a2616aa
commit 285a36f9de
7 changed files with 31 additions and 7 deletions

View file

@ -62,7 +62,6 @@ class CrashReporter {
})
}
this._shouldUpload = shouldUpload
binding.start(this.getProductName(), companyName, submitURL, this.getCrashesDirectory(), shouldUpload, ignoreSystemCrashHandler, extra)
}
@ -104,12 +103,19 @@ class CrashReporter {
}
getShouldUpload() {
return this._shouldUpload
if (process.type === 'browser') {
return binding._getShouldUpload()
} else {
throw new Error('getShouldUpload can only be called from the main process')
}
}
setShouldUpload(shouldUpload) {
this._shouldUpload = shouldUpload
return binding._setShouldUpload(shouldUpload)
if (process.type === 'browser') {
return binding._setShouldUpload(shouldUpload)
} else {
throw new Error('setShouldUpload can only be called from the main process')
}
}
}