【发布时间】:2019-04-30 00:11:14
【问题描述】:
我在 SideDrawer 中有一个注销按钮。当用户点击它时,我想将他/她注销,显示一个下拉警报,该警报保持可见 2000 毫秒,然后 关闭 抽屉。我不想切换抽屉意味着如果用户关闭抽屉我不想重新打开它。我怎样才能做到这一点。我知道有一个toggleDrawer 函数,但这不是我想要的。
我已经搜索了 wix/react-native-navigation 中的问题,但没有发现任何关于此的问题。
这是我的代码:
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 );
} );
};
【问题讨论】:
标签: react-native wix-react-native-navigation