Skip to content
This repository has been archived by the owner on Oct 5, 2022. It is now read-only.

Commit

Permalink
#91 Fix home redirection
Browse files Browse the repository at this point in the history
  • Loading branch information
lbassin committed Jun 19, 2018
1 parent de861ac commit ab4e812
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/app/components/template/template.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,20 @@ export class TemplateComponent implements OnInit {
return;
}

this.template.containers.forEach(async (element: Container) => {
let container: Container = await this.githubService.getContainer(element.configPath);
container = this.containerService.dataToContainer(container, element.config);
const addContainerPromises = [];
this.template.containers.forEach((element: Container) => {
addContainerPromises.push(new Promise(async (resolve) => {
let container: Container = await this.githubService.getContainer(element.configPath);
container = this.containerService.dataToContainer(container, element.config);

this.projectService.addContainer(element.containerId, container);
this.projectService.addContainer(element.containerId, container);
resolve();
}));
});

this.projectService.setFromTemplate(true);
this.router.navigate(['/review']);
Promise.all(addContainerPromises).then(() => {
this.projectService.setFromTemplate(true);
this.router.navigate(['/review']);
});
}
}

0 comments on commit ab4e812

Please sign in to comment.