Skip to content

Commit

Permalink
Merge pull request #31291 from bernhardoj/fix/31136-crash-on-opening-…
Browse files Browse the repository at this point in the history
…on-loading-split-bill

Fix crash when opening a split bill preview on an #announce room
  • Loading branch information
grgia authored Nov 27, 2023
2 parents 514fbb3 + 25e3b56 commit 0c125f9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/ReportActionItem/MoneyRequestPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,15 +358,17 @@ function MoneyRequestPreview(props) {
return childContainer;
}

const shouldDisableOnPress = props.isBillSplit && _.isEmpty(props.transaction);

return (
<PressableWithFeedback
onPress={props.onPreviewPressed}
onPress={shouldDisableOnPress ? undefined : props.onPreviewPressed}
onPressIn={() => DeviceCapabilities.canUseTouchScreen() && ControlSelection.block()}
onPressOut={() => ControlSelection.unblock()}
onLongPress={showContextMenu}
accessibilityLabel={props.isBillSplit ? props.translate('iou.split') : props.translate('iou.cash')}
accessibilityHint={CurrencyUtils.convertToDisplayString(requestAmount, requestCurrency)}
style={[styles.moneyRequestPreviewBox, ...props.containerStyles]}
style={[styles.moneyRequestPreviewBox, ...props.containerStyles, shouldDisableOnPress && styles.cursorDefault]}
>
{childContainer}
</PressableWithFeedback>
Expand Down

0 comments on commit 0c125f9

Please sign in to comment.