diff --git a/src/app/admin/admin.component.ts b/src/app/admin/admin.component.ts index b738b88..f41a4d1 100644 --- a/src/app/admin/admin.component.ts +++ b/src/app/admin/admin.component.ts @@ -10,6 +10,7 @@ import {FullScreenModalComponent} from "../openaireLibrary/utils/modal/full-scre import {EmailService} from "../openaireLibrary/utils/email/email.service"; import {Email} from "../openaireLibrary/utils/email/email"; import {properties} from "../../environments/environment"; +import {error} from "@angular/compiler-cli/src/transformers/util"; @Component({ selector: 'admin', @@ -356,6 +357,7 @@ export class AdminComponent implements OnInit, OnDestroy{ } sendEmail() { + this.loading = true; let email = new Email(); email.body = this.emailForm.get('body').value; email.subject = this.emailForm.get('subject').value; @@ -366,6 +368,10 @@ export class AdminComponent implements OnInit, OnDestroy{ } else { NotificationHandler.rise('An error has occurred. Please try again later!', 'danger'); } + this.loading = false; + }, error => { + NotificationHandler.rise('An error has occurred. Please try again later!', 'danger'); + this.loading = false; }) } }