Skip to content

Commit

Permalink
Merge pull request #53116 from mkzie2/mkzie2-issue/xero-prevent-calli…
Browse files Browse the repository at this point in the history
…ng-API

Prevent calling update xero API when selecting the selected value
  • Loading branch information
lakchote authored Nov 28, 2024
2 parents b84639c 3da6b6b commit 9f0c30b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 59,7 @@ function XeroMapTrackingCategoryConfigurationPage({policy}: WithPolicyProps) {

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 @@ function XeroMapTrackingCategoryConfigurationPage({policy}: WithPolicyProps) {
}
Navigation.goBack(ROUTES.POLICY_ACCOUNTING_XERO_TRACKING_CATEGORIES.getRoute(policyID));
},
[categoryId, categoryName, currentTrackingCategoryValue, policy, policyID],
[categoryId, currentTrackingCategoryValue, policy, policyID],
);

return (
Expand Down

0 comments on commit 9f0c30b

Please sign in to comment.