Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent calling update xero API when selecting the selected value #53116

Merged
merged 3 commits into from
Nov 28, 2024
Merged
Changes from 1 commit
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
Next Next commit
prevent calling update xero API when selecting the selected value
  • Loading branch information
mkzie2 committed Nov 26, 2024
commit a3a535cde718e97ce274144326e1668dc057e339
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 59,7 @@

const updateMapping = useCallback(
(option: {value: string}) => {
if (option.value !== categoryName) {
if (option.value !== currentTrackingCategoryValue) {
if (option.value === CONST.XERO_CONFIG.TRACKING_CATEGORY_OPTIONS.REPORT_FIELD && !isControlPolicy(policy)) {
const backToRoute = ROUTES.WORKSPACE_UPGRADE.getRoute(
policyID,
Expand All @@ -77,7 77,7 @@
}
Navigation.goBack(ROUTES.POLICY_ACCOUNTING_XERO_TRACKING_CATEGORIES.getRoute(policyID));
},
[categoryId, categoryName, currentTrackingCategoryValue, policy, policyID],

Check warning on line 80 in src/pages/workspace/accounting/xero/XeroMapTrackingCategoryConfigurationPage.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

React Hook useCallback has an unnecessary dependency: 'categoryName'. Either exclude it or remove the dependency array
);

return (
Expand Down
Loading