mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-03-06 17:34:59 +08:00
Prevent duplicate drawer events (#3763)
This commit is contained in:
committed by
Eric Vicenti
parent
b1ac152fec
commit
191439f79a
@@ -38,12 +38,18 @@ export default class DrawerView extends React.PureComponent {
|
||||
|
||||
_handleDrawerOpen = () => {
|
||||
const { navigation } = this.props;
|
||||
navigation.dispatch({ type: NavigationActions.OPEN_DRAWER });
|
||||
const { isDrawerOpen } = navigation.state;
|
||||
if (!isDrawerOpen) {
|
||||
navigation.dispatch({ type: NavigationActions.OPEN_DRAWER });
|
||||
}
|
||||
};
|
||||
|
||||
_handleDrawerClose = () => {
|
||||
const { navigation } = this.props;
|
||||
navigation.dispatch({ type: NavigationActions.CLOSE_DRAWER });
|
||||
const { isDrawerOpen } = navigation.state;
|
||||
if (isDrawerOpen) {
|
||||
navigation.dispatch({ type: NavigationActions.CLOSE_DRAWER });
|
||||
}
|
||||
};
|
||||
|
||||
_updateWidth = () => {
|
||||
|
||||
Reference in New Issue
Block a user