I have a function implemented to update my user on firebase, but for some reason the "then" function is never called. Any ideas on how to resolve this issue?
The user's data was successfully updated in the database, and when I try to directly implement the "then" branch within the function, it works as expected.
EDIT () :
// Continue with update
this.statoUtente.updateCurrentUser(uteIn).then(() => {
<<<<<<<<<<<<<<<<<<<<< program never call this >>>>>>>>>>>>>>>>>
console.log('Response from Promise') ;
// After updating, prompt for completing missing information
this.nomeTemplate = 'updateUserForm' ;
this.helperset = 2 ;
this.wait = false ;
this.error = '' ;
})
updateCurrentUser(UteIn: TipoSingoloUtente): Promise<any> {
let Promessa = new Promise<any>(observer => {
let userID = this.afAuth.auth.currentUser.uid ;
console.log(userID) ;
if ((userID) && ( userID.trim() != '' )) {
UteIn.ID = userID ;
observer(this.db.object('users/' + userID).set(UteIn))
} else {
console.log('null null null') ;
Promise.resolve(false) ;
}
}) ;
return Promessa ;
}