Skip to content

Commit 73cad58

Browse files
authored
Merge pull request Expensify#67902 from getusha/fix-mark-as-paid-double-trigger
[CP Staging] fix: prevent selectPaymentType from getting triggered twice
2 parents b44541f + 45e85e5 commit 73cad58

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/components/SettlementButton/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,13 @@ function SettlementButton({
534534
secondLineText={secondaryText}
535535
pressOnEnter={pressOnEnter}
536536
options={paymentButtonOptions}
537-
onOptionSelected={(option) => handlePaymentSelection(undefined, option.value, triggerKYCFlow)}
537+
onOptionSelected={(option) => {
538+
if (paymentButtonOptions.length === 1) {
539+
return;
540+
}
541+
542+
handlePaymentSelection(undefined, option.value, triggerKYCFlow);
543+
}}
538544
style={style}
539545
shouldUseShortForm={shouldUseShortForm}
540546
shouldPopoverUseScrollView={paymentButtonOptions.length > 5}

0 commit comments

Comments
 (0)