Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/components/MoneyRequestConfirmationList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -347,11 +347,11 @@
// Update the tax code when the default changes (for example, because the transaction currency changed)
const defaultTaxCode = getDefaultTaxCode(policy, transaction) ?? '';
useEffect(() => {
if (!transactionID || isReadOnly) {
if (!transactionID || isReadOnly || !shouldShowTax) {
return;
}
setMoneyRequestTaxRate(transactionID, defaultTaxCode);
}, [defaultTaxCode, transactionID, isReadOnly]);
}, [defaultTaxCode, transactionID, isReadOnly, shouldShowTax]);

const distance = getDistanceInMeters(transaction, unit);
const prevDistance = usePrevious(distance);
Expand Down Expand Up @@ -506,11 +506,11 @@
const taxAmount = calculateTaxAmount(taxPercentage, taxableAmount, transaction?.currency ?? CONST.CURRENCY.USD);
const taxAmountInSmallestCurrencyUnits = convertToBackendAmount(Number.parseFloat(taxAmount.toString()));
useEffect(() => {
if (!transactionID || isReadOnly) {
if (!transactionID || isReadOnly || !shouldShowTax) {
return;
}
setMoneyRequestTaxAmount(transactionID, taxAmountInSmallestCurrencyUnits);
}, [transactionID, taxAmountInSmallestCurrencyUnits, isReadOnly]);
}, [transactionID, taxAmountInSmallestCurrencyUnits, isReadOnly, shouldShowTax]);

// If completing a split expense fails, set didConfirm to false to allow the user to edit the fields again
if (isEditingSplitBill && didConfirm) {
Expand Down Expand Up @@ -965,7 +965,7 @@
onSendMoney?.(paymentMethod);
}
},
[

Check warning on line 968 in src/components/MoneyRequestConfirmationList.tsx

View workflow job for this annotation

GitHub Actions / ESLint check

React Hook useCallback has missing dependencies: 'iouCategory' and 'policyCategories'. Either include them or remove the dependency array

Check warning on line 968 in src/components/MoneyRequestConfirmationList.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

React Hook useCallback has missing dependencies: 'iouCategory' and 'policyCategories'. Either include them or remove the dependency array
routeError,
transactionID,
iouType,
Expand Down
Loading
Loading