Skip to content

Commit

Permalink
Merge pull request #41264 from Krishna2323/krishna2323/issue/41075
Browse files Browse the repository at this point in the history
  • Loading branch information
cead22 authored Apr 30, 2024
2 parents c783c6b + 0b0427b commit f6965a8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pages/iou/MoneyRequestAmountForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ function MoneyRequestAmountForm(

const textInput = useRef<BaseTextInputRef | null>(null);
const moneyRequestAmountInput = useRef<MoneyRequestAmountInputRef | null>(null);
const isTaxAmountForm = Navigation.getActiveRoute().includes('taxAmount');

const [formError, setFormError] = useState<MaybePhraseKey>('');
const [shouldUpdateSelection, setShouldUpdateSelection] = useState(true);
Expand Down Expand Up @@ -205,6 +204,8 @@ function MoneyRequestAmountForm(
*/
const submitAndNavigateToNextPage = useCallback(
(iouPaymentType?: PaymentMethodType | undefined) => {
const isTaxAmountForm = Navigation.getActiveRoute().includes('taxAmount');

// Skip the check for tax amount form as 0 is a valid input
const currentAmount = moneyRequestAmountInput.current?.getAmount() ?? '';
if (!currentAmount.length || (!isTaxAmountForm && isAmountInvalid(currentAmount))) {
Expand All @@ -224,7 +225,7 @@ function MoneyRequestAmountForm(

onSubmitButtonPress({amount: currentAmount, currency, paymentMethod: iouPaymentType});
},
[taxAmount, isTaxAmountForm, onSubmitButtonPress, currency, formattedTaxAmount, initializeAmount],
[taxAmount, onSubmitButtonPress, currency, formattedTaxAmount, initializeAmount],
);

const buttonText: string = useMemo(() => {
Expand Down

0 comments on commit f6965a8

Please sign in to comment.