diff --git a/src/pages/workspace/reportFields/ReportFieldsInitialValuePage.tsx b/src/pages/workspace/reportFields/ReportFieldsInitialValuePage.tsx index d2f7a5e69eea..b3744cdce89f 100644 --- a/src/pages/workspace/reportFields/ReportFieldsInitialValuePage.tsx +++ b/src/pages/workspace/reportFields/ReportFieldsInitialValuePage.tsx @@ -43,19 +43,21 @@ function ReportFieldsInitialValuePage({ const hasAccountingConnections = PolicyUtils.hasAccountingConnections(policy); const reportField = policy?.fieldList?.[ReportUtils.getReportFieldKey(reportFieldID)] ?? null; const availableListValuesLength = (reportField?.disabledOptions ?? []).filter((disabledListValue) => !disabledListValue).length; - - const [initialValue, setInitialValue] = useState(WorkspaceReportFieldUtils.getReportFieldInitialValue(reportField)); + const currentInitialValue = WorkspaceReportFieldUtils.getReportFieldInitialValue(reportField); + const [initialValue, setInitialValue] = useState(currentInitialValue); const submitForm = useCallback( (values: FormOnyxValues) => { - ReportField.updateReportFieldInitialValue(policyID, reportFieldID, initialValue === values.initialValue ? '' : values.initialValue); + if (currentInitialValue !== values.initialValue) { + ReportField.updateReportFieldInitialValue(policyID, reportFieldID, values.initialValue); + } Navigation.goBack(); }, [policyID, reportFieldID, initialValue], ); const submitListValueUpdate = (value: string) => { - ReportField.updateReportFieldInitialValue(policyID, reportFieldID, initialValue === value ? '' : value); + ReportField.updateReportFieldInitialValue(policyID, reportFieldID, currentInitialValue === value ? '' : value); Navigation.goBack(); };