Permalink
Browse files

fix(): fixed build running time

  • Loading branch information...
Izak88 committed Aug 31, 2017
1 parent 66cb7f2 commit 83dd607b417405cd753fa27b429a7d3c4ef36bee
@@ -122,7 +122,8 @@ export class AppBuildDetailsComponent implements OnInit, OnDestroy {
if (this.status !== 'running') {
this.totalTime = Math.max(...this.build.jobs.map(job => job.end_time - job.start_time));
} else {
this.totalTime = Math.max(...this.build.jobs.map(job => job.start_time));
this.totalTime = Math.min(...this.build.jobs
.filter(job => job.status === 'running').map(job => job.start_time));
}

this.build.jobs = this.build.jobs.map(job => {
@@ -122,7 +122,8 @@ export class AppBuildsComponent implements OnInit, OnDestroy {
if (status !== 'running') {
build.maxTime = Math.max(...build.jobs.map(job => job.end_time - job.start_time));
} else {
build.maxTime = Math.max(...build.jobs.map(job => job.start_time));
build.maxTime = Math.min(...build.jobs
.filter(job => job.status === 'running').map(job => job.start_time));
}

build.status = status;

0 comments on commit 83dd607

Please sign in to comment.