🔧 Sort crashes

This commit is contained in:
Felix Rieseberg 2018-03-13 13:57:12 -07:00
parent 8e07e7483f
commit 72579f9bab

View file

@ -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
}