Skip to content

Commit

Permalink
delete pending action from XeroChartOfAccountsPage
Browse files Browse the repository at this point in the history
  • Loading branch information
SzymczakJ committed May 14, 2024
1 parent cc5ec33 commit 9ebd3ab
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ function XeroChartOfAccountsPage({policy}: WithPolicyProps) {
const styles = useThemeStyles();
const policyID = policy?.id ?? '';
const xeroConfig = policy?.connections?.xero?.config;
const {enableNewCategories, pendingFields} = xeroConfig ?? {};

return (
<ConnectionLayout
Expand Down Expand Up @@ -57,9 +56,10 @@ function XeroChartOfAccountsPage({policy}: WithPolicyProps) {
subtitle={translate('workspace.xero.accountsSwitchDescription')}
switchAccessibilityLabel={translate('workspace.xero.accountsSwitchDescription')}
shouldPlaceSubtitleBelowSwitch
isActive={!!enableNewCategories}
onToggle={() => Connections.updatePolicyConnectionConfig(policyID, CONST.POLICY.CONNECTIONS.NAME.XERO, CONST.XERO_CONFIG.ENABLE_NEW_CATEGORIES, !enableNewCategories)}
pendingAction={pendingFields?.enableNewCategories}
isActive={!!xeroConfig?.enableNewCategories}
onToggle={() =>
Connections.updatePolicyConnectionConfig(policyID, CONST.POLICY.CONNECTIONS.NAME.XERO, CONST.XERO_CONFIG.ENABLE_NEW_CATEGORIES, !xeroConfig?.enableNewCategories)
}
errors={ErrorUtils.getLatestErrorField(xeroConfig ?? {}, CONST.XERO_CONFIG.ENABLE_NEW_CATEGORIES)}
onCloseError={() => Policy.clearXeroErrorField(policyID, CONST.XERO_CONFIG.ENABLE_NEW_CATEGORIES)}
/>
Expand Down

0 comments on commit 9ebd3ab

Please sign in to comment.