Add loading in sending
This commit is contained in:
parent
512ff36815
commit
a97c39ec96
|
@ -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;
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue