Skip to content

Commit

Permalink
Fix(#23) Fix some issues when adding a picture to a new anomaly and w…
Browse files Browse the repository at this point in the history
…hen adding the first picture.
  • Loading branch information
iamkinetic committed May 17, 2018
1 parent feae271 commit eec4615
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ export class BuildingAnomalyDetailPicturesComponent implements ControlValueAcces
picture.pictureData = pic;
pictCache.push(picture);
this.pictures = pictCache;
this.slides.slideTo(this.slides.length());
if (pictCache.length > 1)
this.slides.slideTo(this.slides.length());
this.repo.save(picture);
this.isUpdatingSlides = false;
}
Expand Down
2 changes: 2 additions & 0 deletions src/pages/building-anomaly-detail/building-anomaly-detail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,13 @@ export class BuildingAnomalyDetailPage {
private createAnomaly() {
this.isNew = true;
let data = new InspectionBuildingAnomaly();
data.notes = "";
data.id = UUID.UUID();
data.theme = this.selectedTheme;
data.idBuilding = this.idBuilding;
this.idBuildingAnomaly = data.id;
this.anomaly = data;
this.repo.save(this.anomaly);
}

public async onDeleteAnomaly() {
Expand Down

0 comments on commit eec4615

Please sign in to comment.