diff --git a/src/app/pages/affiliations/affiliations.component.ts b/src/app/pages/affiliations/affiliations.component.ts index a763f24..0c23412 100644 --- a/src/app/pages/affiliations/affiliations.component.ts +++ b/src/app/pages/affiliations/affiliations.component.ts @@ -167,41 +167,25 @@ export class AffiliationsComponent implements OnInit { } addAffiliation() { - console.info(this.affiliation); if (!this.isEmptyAffiliation()) { + this.utilitiesService.getTiny(this.properties.tinyUrl + this.affiliation.logo_url).subscribe((logo_url)=> { + this.affiliation.logo_url = logo_url; - if(!HelperFunctions.isTiny(this.affiliation.logo_url)) { - this.utilitiesService.getTiny(this.properties.tinyUrl + this.affiliation.logo_url).subscribe((logo_url)=> { - this.affiliation.logo_url = logo_url; - - if(!HelperFunctions.isTiny(this.affiliation.website_url)) { - this.utilitiesService.getTiny(this.properties.tinyUrl + this.affiliation.website_url).subscribe((website_url) => { - this.affiliation.website_url = website_url; - if (!this.curatorAffiliations) { - this.updateCommunityAffiliations(this.index); - } else { - if (this.index === -1) { - this.affiliations.push(this.affiliation); - } else { - this.affiliations[this.index] = this.affiliation; - } - } - this.change(); - }); - } - }) - } else { - if(!this.curatorAffiliations) { - this.updateCommunityAffiliations(this.index); - } else { - if (this.index === -1) { - this.affiliations.push(this.affiliation); + this.utilitiesService.getTiny(this.properties.tinyUrl + this.affiliation.website_url).subscribe((website_url) => { + this.affiliation.website_url = website_url; + + if (!this.curatorAffiliations) { + this.updateCommunityAffiliations(this.index); } else { - this.affiliations[this.index] = this.affiliation; + if (this.index === -1) { + this.affiliations.push(this.affiliation); + } else { + this.affiliations[this.index] = this.affiliation; + } } - } - this.change(); - } + this.change(); + }); + }) } }