11import { Component , ViewChild , OnInit } from '@angular/core' ;
22import { FormBuilder , Validators } from '@angular/forms' ;
3- import { IonContent } from '@ionic/angular' ;
3+ import { AlertController , IonContent } from '@ionic/angular' ;
44import { Router } from '@angular/router' ;
55// Providers
66import { AuthProvider } from '../../../../providers/auth/auth' ;
@@ -22,7 +22,8 @@ export class RecuperarPasswordPage implements OnInit {
2222 private authProvider : AuthProvider ,
2323 private toast : ToastProvider ,
2424 private formBuilder : FormBuilder ,
25- private router : Router ) {
25+ private router : Router ,
26+ public alertCtrl : AlertController ) {
2627 }
2728
2829 ngOnInit ( ) : void {
@@ -49,8 +50,11 @@ export class RecuperarPasswordPage implements OnInit {
4950 this . formResetear . patchValue ( { email } ) ;
5051 } ) . catch ( error => {
5152 this . loading = false ;
53+
5254 if ( error ) {
53- this . toast . danger ( error . error ) ;
55+ this . notificacionVerificacion ( ) ;
56+ console . error ( 'eeee: ' , error . error ) ;
57+ // this.toast.danger(error.error);
5458 }
5559 } ) ;
5660 }
@@ -82,6 +86,20 @@ export class RecuperarPasswordPage implements OnInit {
8286 } ) ;
8387 }
8488
89+ private async notificacionVerificacion ( ) {
90+ const confirm = await this . alertCtrl . create ( {
91+ header : 'Notificación de código de verificación' ,
92+ message : '<p>Ya posee un código de verificación para cambiar su contraseña.</p>' ,
93+ buttons : [
94+ {
95+ text : 'Volver' ,
96+ handler : ( ) => { this . router . navigateByUrl ( '/login' ) ; }
97+ }
98+ ]
99+ } ) ;
100+ await confirm . present ( ) ;
101+ }
102+
85103 public cancel ( ) {
86104 this . displayForm = false ,
87105 this . reset = { } ;
0 commit comments