Prevent duplicate drawer events (#3763)

This commit is contained in:
Jakob Murko
2018-03-16 23:36:31 +01:00
committed by Eric Vicenti
parent b1ac152fec
commit 191439f79a

View File

@@ -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 = () => {