Added challenges past in profil page
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import {Component, inject, OnInit, signal, viewChild} from '@angular/core';
|
||||
import {IonicModule, NavController, ToastController} from "@ionic/angular";
|
||||
import {IonicModule, LoadingController, NavController, ToastController} from "@ionic/angular";
|
||||
import {SignInFormComponent} from "../../components/sign-in-form/sign-in-form.component";
|
||||
import {SignOnFormComponent} from "../../components/sign-on-form/sign-on-form.component";
|
||||
import {AuthManageService} from "../../services/auth-manage";
|
||||
@@ -26,6 +26,7 @@ export class LoginComponent implements OnInit {
|
||||
private usersService = inject(UsersService);
|
||||
private navCtrl = inject(NavController);
|
||||
private toastCtrl = inject(ToastController);
|
||||
private loadCtrl = inject(LoadingController);
|
||||
|
||||
ngOnInit() {
|
||||
this.authManageService.logout();
|
||||
@@ -48,6 +49,12 @@ export class LoginComponent implements OnInit {
|
||||
}
|
||||
|
||||
async connectUser() {
|
||||
const loading = await this.loadCtrl.create({
|
||||
message: 'Connexion...',
|
||||
spinner: 'lines-sharp-small'
|
||||
});
|
||||
await loading.present();
|
||||
|
||||
const user = this.login().loginForm.getRawValue();
|
||||
this.errorMessage.set(null);
|
||||
|
||||
@@ -71,9 +78,16 @@ export class LoginComponent implements OnInit {
|
||||
|
||||
this.login().loginForm.reset();
|
||||
}
|
||||
await loading.dismiss();
|
||||
}
|
||||
|
||||
async addUser() {
|
||||
const loading = await this.loadCtrl.create({
|
||||
message: 'Connexion...',
|
||||
spinner: 'lines-sharp-small'
|
||||
});
|
||||
await loading.present();
|
||||
|
||||
if (this.user().userForm.invalid) {
|
||||
const toast = await this.toastCtrl.create({
|
||||
message: 'Tout les champs sont requis',
|
||||
@@ -95,5 +109,6 @@ export class LoginComponent implements OnInit {
|
||||
});
|
||||
await toast.present();
|
||||
}
|
||||
await loading.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user