Skip to content

Commit 387097e

Browse files
committed
Prevent API call in taxes page
1 parent d263830 commit 387097e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/pages/workspace/taxes/ValuePage.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,14 @@ function ValuePage({
4242

4343
const submit = useCallback(
4444
(values: FormOnyxValues<typeof ONYXKEYS.FORMS.WORKSPACE_TAX_VALUE_FORM>) => {
45+
if (defaultValue === values.value) {
46+
goBack();
47+
return;
48+
}
4549
updatePolicyTaxValue(policyID, taxID, Number(values.value));
4650
goBack();
4751
},
48-
[goBack, policyID, taxID],
52+
[goBack, policyID, taxID, defaultValue],
4953
);
5054

5155
if (!currentTaxRate) {

0 commit comments

Comments
 (0)