|
@@ -13,10 +13,12 @@ class CrashReporter {
|
|
|
options = {}
|
|
|
}
|
|
|
this.productName = options.productName != null ? options.productName : app.getName()
|
|
|
- let {autoSubmit, companyName, extra, ignoreSystemCrashHandler, submitURL} = options
|
|
|
+ let {autoSubmit, companyName, extra, ignoreSystemCrashHandler, submitURL, shouldUpload} = options
|
|
|
|
|
|
- if (autoSubmit == null) {
|
|
|
- autoSubmit = true
|
|
|
+ if (autoSubmit == null && shouldUpload == null) {
|
|
|
+ shouldUpload = true
|
|
|
+ } else {
|
|
|
+ shouldUpload = shouldUpload || autoSubmit
|
|
|
}
|
|
|
if (ignoreSystemCrashHandler == null) {
|
|
|
ignoreSystemCrashHandler = false
|
|
@@ -56,7 +58,8 @@ class CrashReporter {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- binding.start(this.getProductName(), companyName, submitURL, this.getCrashesDirectory(), autoSubmit, ignoreSystemCrashHandler, extra)
|
|
|
+ this._shouldUpload = shouldUpload
|
|
|
+ binding.start(this.getProductName(), companyName, submitURL, this.getCrashesDirectory(), shouldUpload, ignoreSystemCrashHandler, extra)
|
|
|
}
|
|
|
|
|
|
getLastCrashReport () {
|
|
@@ -95,6 +98,15 @@ class CrashReporter {
|
|
|
}
|
|
|
return this.tempDirectory
|
|
|
}
|
|
|
+
|
|
|
+ getShouldUpload() {
|
|
|
+ return this._shouldUpload
|
|
|
+ }
|
|
|
+
|
|
|
+ setShouldUpload(shouldUpload) {
|
|
|
+ this._shouldUpload = shouldUpload
|
|
|
+ return bindings._setShouldUpload(shouldUpload)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
module.exports = new CrashReporter()
|