web/firebase/gallery.js
/**
 * Pulls all the images assigned to a user from Firestore and calls for the images 
 * to be written to the viewable HTML page
 */
Pulls all the images assigned to a user from Firestore and calls for the images
to be written to the viewable HTML page
Pulls all the images assigned to a user from Firestore and calls for the images to be written to the viewable HTML page
function displayGallery() {
  var i = 0;
  db.collection("users").doc(currentUser.email).collection("images").get().then(function (querySnapshot) {
    querySnapshot.forEach(function (doc) {
      console.log(doc.id, " => ", doc.data());
      addImageToGallery(doc.data().image, i);
      if (i++ >= 3) {
        i = 0;
      }
    });
  }).catch(function (error) {
    console.log("Error getting documents: ", error);
  });
}
function displayGallery ( ) { var i = 0 ; db . collection ( "users" ) . doc ( currentUser . email ) . collection ( "images" ) . get ( ) . then ( function ( querySnapshot ) { querySnapshot . forEach ( function ( doc ) { console . log ( doc . id , " => " , doc . data ( ) ) ; addImageToGallery ( doc . data ( ) . image , i ) ; if ( i ++ >= 3 ) { i = 0 ; } } ) ; } ) . catch ( function ( error ) { console . log ( "Error getting documents: " , error ) ; } ) ; }
Pulls all the images assigned to a user from Firestore and calls for the images
 to be written to the viewable HTML page
Pulls all the images assigned to a user from Firestore and calls for the images to be written to the viewable HTML page
// doc.data() is never undefined for query doc snapshots