|
|
|
@ -230,31 +230,31 @@ export class EnvoyerCarteComponent implements OnInit, OnDestroy {
|
|
|
|
|
this.carteEnvoieOK = false;
|
|
|
|
|
})
|
|
|
|
|
.then(function(userCreate) {
|
|
|
|
|
// I don't know if the next statement is necessary
|
|
|
|
|
const imagePath = 'profilImage/' + userCreate.uid + '/userPic.jpg';
|
|
|
|
|
const dbRef = firebase.database().ref();
|
|
|
|
|
const userRef = dbRef.child('Parrain').child(userCreate.uid);
|
|
|
|
|
userCreate.updateProfile({
|
|
|
|
|
displayName: parrainTemp.status,
|
|
|
|
|
photoURL: imagePath,
|
|
|
|
|
emailVerified: true
|
|
|
|
|
});
|
|
|
|
|
try {
|
|
|
|
|
parrainTemp.uid = userCreate.uid;
|
|
|
|
|
parrainTemp.emailVerified = userCreate.emailVerified;
|
|
|
|
|
userRef.set(parrainTemp);
|
|
|
|
|
if(userCreate){
|
|
|
|
|
// I don't know if the next statement is necessary
|
|
|
|
|
const imagePath = 'profilImage/' + userCreate.uid + '/userPic.jpg';
|
|
|
|
|
const dbRef = firebase.database().ref();
|
|
|
|
|
const userRef = dbRef.child('Parrain').child(userCreate.uid);
|
|
|
|
|
userCreate.updateProfile({
|
|
|
|
|
displayName: parrainTemp.status,
|
|
|
|
|
photoURL: imagePath,
|
|
|
|
|
emailVerified: true
|
|
|
|
|
});
|
|
|
|
|
try {
|
|
|
|
|
parrainTemp.uid = userCreate.uid;
|
|
|
|
|
parrainTemp.emailVerified = userCreate.emailVerified;
|
|
|
|
|
userRef.set(parrainTemp);
|
|
|
|
|
|
|
|
|
|
this.secondaryApp.auth().sendPasswordResetEmail(userCreate.email);
|
|
|
|
|
userCreate.sendEmailVerification();
|
|
|
|
|
|
|
|
|
|
this.secondaryApp.auth().signOut();
|
|
|
|
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
// No content response..
|
|
|
|
|
console.log(e);
|
|
|
|
|
// this.goToOpComm();
|
|
|
|
|
// this.router.navigate(['/']);
|
|
|
|
|
} catch (e) {
|
|
|
|
|
// No content response..
|
|
|
|
|
console.log(e);
|
|
|
|
|
// this.goToOpComm();
|
|
|
|
|
// this.router.navigate(['/']);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// fin
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -276,6 +276,9 @@ export class EnvoyerCarteComponent implements OnInit, OnDestroy {
|
|
|
|
|
this.carteEnvoieEncours = true;
|
|
|
|
|
this.carteEnvoieOK = true;
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.secondaryApp.auth().sendPasswordResetEmail(elementParTemp.email);
|
|
|
|
|
this.secondaryApp.auth().currentUser.sendEmailVerification();
|
|
|
|
|
this.secondaryApp.auth().signOut();
|
|
|
|
|
this.carteEnvoieEncours = false;
|
|
|
|
|
this.goToOpComm();
|
|
|
|
|
this.toastrService.success('Envoie de la carte à ' + elementParTemp.familyname
|
|
|
|
@ -287,6 +290,7 @@ export class EnvoyerCarteComponent implements OnInit, OnDestroy {
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
this.carteEnvoieOK = false;
|
|
|
|
|
this.echecRegisterPar = true;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
@ -437,8 +441,9 @@ export class EnvoyerCarteComponent implements OnInit, OnDestroy {
|
|
|
|
|
//////
|
|
|
|
|
|
|
|
|
|
ngOnDestroy() {
|
|
|
|
|
this.secondaryApp.delete();
|
|
|
|
|
this.validC = '';
|
|
|
|
|
if (this.subscription){
|
|
|
|
|
if (this.subscription) {
|
|
|
|
|
this.subscription.unsubscribe();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|