function authStateObserver(user) {
  if (user) { // User is signed in!
    // Get the signed-in user's profile pic and name.
    var profilePicUrl = getProfilePicUrl();
    var userName = getUserName();

    // Set the user's profile pic and name.
    userPicElement.style.backgroundImage = 'url(' + addSizeToGoogleProfilePic(profilePicUrl) + ')';
    userNameElement.textContent = userName;

    // Show user's profile and sign-out button.
    userNameElement.removeAttribute('hidden');
    userPicElement.removeAttribute('hidden');
    signOutButtonElement.removeAttribute('hidden');

    // Hide sign-in button.
    signInButtonElement.setAttribute('hidden', 'true');

    // Hide sign-in notification bar
    signinNoticeElement.setAttribute("style", "display:none");

    //Show user feed
    feedElement.setAttribute("style", "display:block");

    // We save the Firebase Messaging Device token and enable notifications.
    saveMessagingDeviceToken();

    //Check if admin
    user.providerData.forEach(function (profile) {

      
      if(profile.uid==103455312348040801272){
        //User is Admin do something different
        userPicElement.setAttribute('hidden', 'true');
      }
    });




  } else { // User is signed out!
    // Hide user's profile and sign-out button.
    userNameElement.setAttribute('hidden', 'true');
    userPicElement.setAttribute('hidden', 'true');
    signOutButtonElement.setAttribute('hidden', 'true');

    // Show sign-in button.
    signInButtonElement.removeAttribute('hidden');

    // Show notification bar
    signinNoticeElement.setAttribute("style", "display:block");

    // Hide user feed
   feedElement.setAttribute("style", "display:none");


  }
}
// Triggers when the auth state change for instance when the user signs-in or signs-out.
Triggers when the auth state change for instance when the user signs-in or signs-out.
Triggers when the auth state change for instance when the user signs - in or signs - out .
function authStateObserver(user) {
  if (user) { 
    var profilePicUrl = getProfilePicUrl();
    var userName = getUserName();
    userPicElement.style.backgroundImage = 'url(' + addSizeToGoogleProfilePic(profilePicUrl) + ')';
    userNameElement.textContent = userName;
    userNameElement.removeAttribute('hidden');
    userPicElement.removeAttribute('hidden');
    signOutButtonElement.removeAttribute('hidden');
    signInButtonElement.setAttribute('hidden', 'true');
    signinNoticeElement.setAttribute("style", "display:none");
    feedElement.setAttribute("style", "display:block");
    saveMessagingDeviceToken();
    user.providerData.forEach(function (profile) {
      if(profile.uid==103455312348040801272){
        userPicElement.setAttribute('hidden', 'true');
      }
    });
  } else { 
    userNameElement.setAttribute('hidden', 'true');
    userPicElement.setAttribute('hidden', 'true');
    signOutButtonElement.setAttribute('hidden', 'true');
    signInButtonElement.removeAttribute('hidden');
    signinNoticeElement.setAttribute("style", "display:block");
   feedElement.setAttribute("style", "display:none");
  }
}
function authStateObserver ( user ) { if ( user ) { var profilePicUrl = getProfilePicUrl ( ) ; var userName = getUserName ( ) ; userPicElement . style . backgroundImage = 'url(' + addSizeToGoogleProfilePic ( profilePicUrl ) + ')' ; userNameElement . textContent = userName ; userNameElement . removeAttribute ( 'hidden' ) ; userPicElement . removeAttribute ( 'hidden' ) ; signOutButtonElement . removeAttribute ( 'hidden' ) ; signInButtonElement . setAttribute ( 'hidden' , 'true' ) ; signinNoticeElement . setAttribute ( "style" , "display:none" ) ; feedElement . setAttribute ( "style" , "display:block" ) ; saveMessagingDeviceToken ( ) ; user . providerData . forEach ( function ( profile ) { if ( profile . uid == 103455312348040801272 ) { userPicElement . setAttribute ( 'hidden' , 'true' ) ; } } ) ; } else { userNameElement . setAttribute ( 'hidden' , 'true' ) ; userPicElement . setAttribute ( 'hidden' , 'true' ) ; signOutButtonElement . setAttribute ( 'hidden' , 'true' ) ; signInButtonElement . removeAttribute ( 'hidden' ) ; signinNoticeElement . setAttribute ( "style" , "display:block" ) ; feedElement . setAttribute ( "style" , "display:none" ) ; } }
Triggers when the auth state change for instance when the user signs-in or signs-out.
Triggers when the auth state change for instance when the user signs - in or signs - out .
// User is signed in! // Get the signed-in user's profile pic and name. // Set the user's profile pic and name. // Show user's profile and sign-out button. // Hide sign-in button. // Hide sign-in notification bar //Show user feed // We save the Firebase Messaging Device token and enable notifications. //Check if admin //User is Admin do something different // User is signed out! // Hide user's profile and sign-out button. // Show sign-in button. // Show notification bar // Hide user feed