function updateUserToDB(totalErrors, friendEditInt, inviteEditInt){
  if(inviteEditInt > 0) {
    var supplementaryInvitesArr = user.invites;
    firebase.database().ref("users/" + user.uid).update({
      invites: user.invites
    });
    user.invites = supplementaryInvitesArr;
  }
  if(friendEditInt > 0) {
    var supplementaryFriendsArr = user.friends;
    firebase.database().ref("users/" + user.uid).update({
      friends: user.friends
    });
    user.friends = supplementaryFriendsArr;
  }
  console.log("Updates pushed!");
}
//If a user's data is shown to contain errors, then it will be updated to the database in this function
If a user's data is shown to contain errors, then it will be updated to the database in this function
If a user ' s data is shown to contain errors then it will be updated to the database in this function
function updateUserToDB(totalErrors, friendEditInt, inviteEditInt){
  if(inviteEditInt > 0) {
    var supplementaryInvitesArr = user.invites;
    firebase.database().ref("users/" + user.uid).update({
      invites: user.invites
    });
    user.invites = supplementaryInvitesArr;
  }
  if(friendEditInt > 0) {
    var supplementaryFriendsArr = user.friends;
    firebase.database().ref("users/" + user.uid).update({
      friends: user.friends
    });
    user.friends = supplementaryFriendsArr;
  }
  console.log("Updates pushed!");
}
function updateUserToDB ( totalErrors , friendEditInt , inviteEditInt ) { if ( inviteEditInt > 0 ) { var supplementaryInvitesArr = user . invites ; firebase . database ( ) . ref ( "users/" + user . uid ) . update ( { invites : user . invites } ) ; user . invites = supplementaryInvitesArr ; } if ( friendEditInt > 0 ) { var supplementaryFriendsArr = user . friends ; firebase . database ( ) . ref ( "users/" + user . uid ) . update ( { friends : user . friends } ) ; user . friends = supplementaryFriendsArr ; } console . log ( "Updates pushed!" ) ; }
If a user's data is shown to contain errors, then it will be updated to the database in this function
If a user ' s data is shown to contain errors then it will be updated to the database in this function