indexON erreur OK bug list carte envoyer de admin OK

thierry
Tmadkaud 7 years ago
parent 5442c4dc83
commit b455613d17

@ -32,7 +32,7 @@ export class ListCarteEnvoyerComponent implements OnInit, OnDestroy {
this.route.params.subscribe(params => {
this.carteParList = this.afDb.list('/CarteParrainage/', {
query: {
orderByChild: 'operationCommercialID',
orderByChild: 'operationCommercialCarte/uid',
equalTo: params['idOp']
}
});

@ -157,7 +157,7 @@ export class ListeOpCommercialComponent implements OnInit, OnDestroy {
carteEnvoyer(op: OperationCommerciale){
this.opCommData = this.afDb.list('/CarteParrainage/',{
query: {
orderByChild: 'operationCommercialID',
orderByChild: 'operationCommercialCarte/uid',
equalTo: op.uid
}
}).map((array) => array.reverse()) as FirebaseListObservable<any[]>;

@ -1,4 +1,4 @@
import { Component, OnInit, EventEmitter } from '@angular/core';
import { Component, OnInit, OnDestroy, EventEmitter } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Router } from '@angular/router';
@ -18,7 +18,7 @@ import { Commercant } from '../../../../models/Commercant';
styleUrls: ['./edit-profil.component.scss'],
providers: [AuthService]
})
export class EditProfilComponent implements OnInit {
export class EditProfilComponent implements OnInit, OnDestroy {
user: Observable<firebase.User>;
localUser: any;
@ -49,7 +49,7 @@ export class EditProfilComponent implements OnInit {
this.parrainDateTimeTest = new Date(this.parrain.birthday);
this.user.subscribe(
(auth) => {
console.log(auth.displayName);
// console.log(auth.displayName);
if (auth) {
this.profileData = this.afDb.list('/' + auth.displayName + '/', {
query: {
@ -124,7 +124,7 @@ export class EditProfilComponent implements OnInit {
goToProfil() {
this.router.navigate(['/profil']);
}
ngOnDestroy(){}
ngOnInit() {
var inputs = document.querySelectorAll( '.inputfile' );
Array.prototype.forEach.call( inputs, function( input )

@ -119,10 +119,12 @@ export class AuthService {
console.log('salut le ' + this.utilisateur.email + ' ' + this.utilisateur.status + ' has signed!');
firebase.auth().onAuthStateChanged(function (userUpdate) {
userUpdate.updateProfile({
displayName: elementParrain.status,
photoURL: elementParrain.image.downloadURL
});
if(userUpdate !== null){
userUpdate.updateProfile({
displayName: elementParrain.status,
photoURL: elementParrain.image.downloadURL
});
}
});
if (this.utilisateur.status === 'Parrain') {
this.router.navigate(['/carteParrainageComponent']);
@ -152,10 +154,12 @@ export class AuthService {
if (/*user.emailVerified*/true){
console.log('salut le ' + this.utilisateur.email + ' ' + this.utilisateur.status + ' has signed!');
firebase.auth().onAuthStateChanged(function (userUpdate) {
userUpdate.updateProfile({
displayName: elementCommercant.status,
photoURL: elementCommercant.image.downloadURL
});
if (userUpdate !== null){
userUpdate.updateProfile({
displayName: elementCommercant.status,
photoURL: elementCommercant.image.downloadURL
});
}
});
if (this.utilisateur.status === 'Parrain') {
this.router.navigate(['/carteParrainageComponent']);
@ -257,13 +261,15 @@ export class AuthService {
});
}
firebase.auth().onAuthStateChanged(function (userUpdate) {
userUpdate.updateProfile({
displayName: info.status,
photoURL: info.image.downloadURL
}).then(al => {
console.log('userUpdate.dispppp : ' + al);
// firebase.auth().signOut();
});
if (userUpdate !== null){
userUpdate.updateProfile({
displayName: info.status,
photoURL: info.image.downloadURL
}).then(al => {
console.log('userUpdate.dispppp : ' + al);
// firebase.auth().signOut();
});
}
});
return true;
@ -291,10 +297,12 @@ export class AuthService {
});
}
firebase.auth().onAuthStateChanged(function (userUpdate) {
userUpdate.updateProfile({
displayName: info.status,
photoURL: info.image.downloadURL
});
if (userUpdate !== null){
userUpdate.updateProfile({
displayName: info.status,
photoURL: info.image.downloadURL
});
}
if (userUpdate) {
console.log('userUpdate: ' + userUpdate);
} else {

Loading…
Cancel
Save