Skip to content

Commit

Permalink
Merge pull request #19940 from Expensify/marco-fixAnonymousMenuActions
Browse files Browse the repository at this point in the history
  • Loading branch information
marcochavezf authored Jun 5, 2023
2 parents 0813e2c + 1934e0c commit 50fbe9a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/MenuItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import withWindowDimensions, {windowDimensionsPropTypes} from './withWindowDimen
import * as DeviceCapabilities from '../libs/DeviceCapabilities';
import ControlSelection from '../libs/ControlSelection';
import variables from '../styles/variables';
import * as Session from '../libs/actions/Session';

const propTypes = {
...menuItemPropTypes,
Expand Down Expand Up @@ -98,7 +99,7 @@ const MenuItem = (props) => {

return (
<PressableWithSecondaryInteraction
onPress={(e) => {
onPress={Session.checkIfActionIsAllowed((e) => {
if (props.disabled || !props.interactive) {
return;
}
Expand All @@ -108,7 +109,7 @@ const MenuItem = (props) => {
}

props.onPress(e);
}}
})}
onPressIn={() => props.shouldBlockSelection && props.isSmallScreenWidth && DeviceCapabilities.canUseTouchScreen() && ControlSelection.block()}
onPressOut={ControlSelection.unblock}
onSecondaryInteraction={props.onSecondaryInteraction}
Expand Down

0 comments on commit 50fbe9a

Please sign in to comment.