I have a Logout button in the SideDrawer. When the user hits it, I want to log him/her out, display a drop down alert that remains visible for 2000 ms and then close the drawer. I do not want to toggle the drawer meaning that if the user closes the drawer I do not want to reopen it. How can I do that. I know that there is a toggleDrawer
function but that's not what I want.
I have searched the issues in wix/react-native-navigation but did not find any issue talking about this.
Here is my code:
signUserOut = () => {
firebase.auth().signOut()
.then( response => {
this.dropDownAlert.alertWithType( "success", "Success", "Signed out successfully", null, 2000 );
setTimeout( () => {
// TODO: We need to close the drawer if it is open not toggle it
this.props.navigator.toggleDrawer( {
side: "left"
} );
}, 2500 );
} )
.catch( error => {
console.log( "Error signing out:", error );
this.dropDownAlert.alertWithType( "error", "Error", "Failed signing out. Please, try again.", null, 2000 );
} );
};