Skip to content

Commit

Permalink
Merge pull request Expensify#14412 from Expensify/marco-fixRedDotAvatar
Browse files Browse the repository at this point in the history
Disable onConfirm if modal is dismissing
  • Loading branch information
Chris Kosuke Tseng authored Jan 26, 2023
2 parents b373c27 + 3bc8179 commit 7f45637
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/ConfirmModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ const ConfirmModal = props => (
>
<ConfirmContent
title={props.title}
onConfirm={props.onConfirm}

/* Disable onConfirm function if the modal is being dismissed, otherwise the confirmation
function can be triggered multiple times if the user clicks on the button multiple times. */
onConfirm={() => (props.isVisible ? props.onConfirm() : null)}
onCancel={props.onCancel}
confirmText={props.confirmText}
cancelText={props.cancelText}
Expand Down

0 comments on commit 7f45637

Please sign in to comment.