Permalink
Browse files

fix(builds): add condition to check if jobs are present

  • Loading branch information...
jkuri committed Aug 20, 2017
1 parent 8d4c85f commit 3ce43ebfca026d3c3e510b5d95c91dbd8f97b7b4
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/app/components/app-builds/app-builds.component.ts
@@ -50,6 +50,10 @@ export class AppBuildsComponent implements OnInit, OnDestroy {
})
.subscribe(e => {
const build = this.builds.findIndex(build => build.id === e.build_id);
if (build === -1) {
return;
}

const index = this.builds[build].jobs.findIndex(job => job.id === e.job_id);
if (index !== -1) {
switch (e.data) {
@@ -87,8 +91,6 @@ export class AppBuildsComponent implements OnInit, OnDestroy {
const currentTime = new Date().getTime() - this.socketService.timeSyncDiff;

this.builds = this.builds.map(build => {
console.log(build);

build.jobs = build.jobs.map(job => {
if (!job.end_time || job.status === 'running') {
job.time = format(currentTime - job.start_time, 'mm:ss');

0 comments on commit 3ce43eb

Please sign in to comment.