function deleteInvite(uid) {
    var verifyDeleteBool = true;
    var toDelete = -1;

    console.log("Deleting " + uid);
    for (var i = 0; i < inviteArr.length; i++){
      if(inviteArr[i] == uid) {
        toDelete = i;
        break;
      }
    }

    if(toDelete != -1) {
      inviteArr.splice(toDelete, 1);

      for (var i = 0; i < inviteArr.length; i++) {
        if (inviteArr[i] == uid) {
          verifyDeleteBool = false;
          break;
        }
      }
    } else {
      verifyDeleteBool = false;
    }

    if(verifyDeleteBool){
      user.invites = inviteArr;
      firebase.database().ref("users/" + user.uid).update({
        invites: inviteArr
      });

      if(inviteArr.length == 0)
        navigation(2);
    }
  }
//This function removes the invite from the current user's invite list and then updates the invite list to the database.
This function removes the invite from the current user's invite list and then updates the invite list to the database.
This function removes the invite from the current user ' s invite list and then updates the invite list to the database .
function deleteInvite(uid) {
    var verifyDeleteBool = true;
    var toDelete = -1;
    console.log("Deleting " + uid);
    for (var i = 0; i < inviteArr.length; i++){
      if(inviteArr[i] == uid) {
        toDelete = i;
        break;
      }
    }
    if(toDelete != -1) {
      inviteArr.splice(toDelete, 1);
      for (var i = 0; i < inviteArr.length; i++) {
        if (inviteArr[i] == uid) {
          verifyDeleteBool = false;
          break;
        }
      }
    } else {
      verifyDeleteBool = false;
    }
    if(verifyDeleteBool){
      user.invites = inviteArr;
      firebase.database().ref("users/" + user.uid).update({
        invites: inviteArr
      });
      if(inviteArr.length == 0)
        navigation(2);
    }
  }
function deleteInvite ( uid ) { var verifyDeleteBool = true ; var toDelete = - 1 ; console . log ( "Deleting " + uid ) ; for ( var i = 0 ; i < inviteArr . length ; i ++ ) { if ( inviteArr [ i ] == uid ) { toDelete = i ; break ; } } if ( toDelete != - 1 ) { inviteArr . splice ( toDelete , 1 ) ; for ( var i = 0 ; i < inviteArr . length ; i ++ ) { if ( inviteArr [ i ] == uid ) { verifyDeleteBool = false ; break ; } } } else { verifyDeleteBool = false ; } if ( verifyDeleteBool ) { user . invites = inviteArr ; firebase . database ( ) . ref ( "users/" + user . uid ) . update ( { invites : inviteArr } ) ; if ( inviteArr . length == 0 ) navigation ( 2 ) ; } }
This function removes the invite from the current user's invite list and then updates the invite list to the database.
This function removes the invite from the current user ' s invite list and then updates the invite list to the database .