🔧 Sort crashes
This commit is contained in:
parent
8e07e7483f
commit
72579f9bab
1 changed files with 6 additions and 0 deletions
|
@ -65,6 +65,12 @@ class CrashReporter {
|
|||
|
||||
getLastCrashReport () {
|
||||
const reports = this.getUploadedReports()
|
||||
.sort((a, b) => {
|
||||
const ats = (a && a.timestamp) ? new Date(a.timestamp).getTime() : 0
|
||||
const bts = (b && b.timestamp) ? new Date(b.timestamp).getTime() : 0
|
||||
return bts - ats
|
||||
})
|
||||
|
||||
return (reports.length > 0) ? reports[0] : null
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue