Support calling getUploadedReports on unstarted crash reporter
This commit is contained in:
parent
56d9ce34e4
commit
43702e0f8e
1 changed files with 4 additions and 2 deletions
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
const {spawn} = require('child_process')
|
const {spawn} = require('child_process')
|
||||||
const electron = require('electron')
|
const electron = require('electron')
|
||||||
|
const {app} = process.type === 'browser' ? electron : electron.remote
|
||||||
const binding = process.atomBinding('crash_reporter')
|
const binding = process.atomBinding('crash_reporter')
|
||||||
|
|
||||||
class CrashReporter {
|
class CrashReporter {
|
||||||
|
@ -12,7 +13,6 @@ class CrashReporter {
|
||||||
this.productName = options.productName
|
this.productName = options.productName
|
||||||
let {autoSubmit, companyName, extra, ignoreSystemCrashHandler, submitURL} = options
|
let {autoSubmit, companyName, extra, ignoreSystemCrashHandler, submitURL} = options
|
||||||
|
|
||||||
const app = (process.type === 'browser' ? electron : electron.remote).app
|
|
||||||
this.tempDirectory = app.getPath('temp')
|
this.tempDirectory = app.getPath('temp')
|
||||||
if (this.productName == null) {
|
if (this.productName == null) {
|
||||||
this.productName = app.getName()
|
this.productName = app.getName()
|
||||||
|
@ -66,7 +66,9 @@ class CrashReporter {
|
||||||
}
|
}
|
||||||
|
|
||||||
getUploadedReports () {
|
getUploadedReports () {
|
||||||
return binding._getUploadedReports(this.productName, this.tempDirectory)
|
const productName = this.productName != null ? this.productName : app.getName()
|
||||||
|
const tempDirectory = this.tempDirectory != null ? this.tempDirectory : app.getPath('temp')
|
||||||
|
return binding._getUploadedReports(productName, tempDirectory)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue