Fixed error with loading
This commit is contained in:
@@ -82,12 +82,6 @@ export class LoginComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async addUser() {
|
async addUser() {
|
||||||
const loading = await this.loadCtrl.create({
|
|
||||||
message: 'Connexion...',
|
|
||||||
spinner: 'lines-sharp-small'
|
|
||||||
});
|
|
||||||
await loading.present();
|
|
||||||
|
|
||||||
if (this.user().userForm.invalid) {
|
if (this.user().userForm.invalid) {
|
||||||
const toast = await this.toastCtrl.create({
|
const toast = await this.toastCtrl.create({
|
||||||
message: 'Tout les champs sont requis',
|
message: 'Tout les champs sont requis',
|
||||||
@@ -97,6 +91,13 @@ export class LoginComponent implements OnInit {
|
|||||||
await toast.present();
|
await toast.present();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const loading = await this.loadCtrl.create({
|
||||||
|
message: 'Création du compte...',
|
||||||
|
spinner: 'lines-sharp-small'
|
||||||
|
});
|
||||||
|
await loading.present();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const users = this.user().userForm.getRawValue();
|
const users = this.user().userForm.getRawValue();
|
||||||
await firstValueFrom(this.usersService.createUserEndpoint(users));
|
await firstValueFrom(this.usersService.createUserEndpoint(users));
|
||||||
|
|||||||
Reference in New Issue
Block a user