diff --git a/src/pages/workspace/accounting/netsuite/advanced/NetSuiteAccountingMethodPage.tsx b/src/pages/workspace/accounting/netsuite/advanced/NetSuiteAccountingMethodPage.tsx index 4a75c261c7cf..a5c1872158e9 100644 --- a/src/pages/workspace/accounting/netsuite/advanced/NetSuiteAccountingMethodPage.tsx +++ b/src/pages/workspace/accounting/netsuite/advanced/NetSuiteAccountingMethodPage.tsx @@ -37,6 +37,9 @@ function NetSuiteAccountingMethodPage({policy}: WithPolicyConnectionsProps) { isSelected: accountingMethod === accountingMethodType, })); + const pendingAction = + settingsPendingAction([CONST.NETSUITE_CONFIG.AUTO_SYNC], autoSyncConfig?.pendingFields) ?? settingsPendingAction([CONST.NETSUITE_CONFIG.ACCOUNTING_METHOD], config?.pendingFields); + const headerContent = useMemo( () => ( @@ -70,10 +73,7 @@ function NetSuiteAccountingMethodPage({policy}: WithPolicyConnectionsProps) { featureName={CONST.POLICY.MORE_FEATURES.ARE_CONNECTIONS_ENABLED} onBackButtonPress={() => Navigation.goBack(ROUTES.POLICY_ACCOUNTING_NETSUITE_AUTO_SYNC.getRoute(policyID))} connectionName={CONST.POLICY.CONNECTIONS.NAME.NETSUITE} - pendingAction={ - settingsPendingAction([CONST.NETSUITE_CONFIG.ACCOUNTING_METHOD], config?.pendingFields) ?? - settingsPendingAction([CONST.NETSUITE_CONFIG.AUTO_SYNC], autoSyncConfig?.pendingFields) - } + pendingAction={pendingAction} /> ); } diff --git a/src/pages/workspace/accounting/netsuite/advanced/NetSuiteAutoSyncPage.tsx b/src/pages/workspace/accounting/netsuite/advanced/NetSuiteAutoSyncPage.tsx index 83fb40fdc038..e75496caa451 100644 --- a/src/pages/workspace/accounting/netsuite/advanced/NetSuiteAutoSyncPage.tsx +++ b/src/pages/workspace/accounting/netsuite/advanced/NetSuiteAutoSyncPage.tsx @@ -26,6 +26,8 @@ function NetSuiteAutoSyncPage({policy, route}: WithPolicyConnectionsProps) { const autoSyncConfig = policy?.connections?.netsuite?.config; const policyID = route.params.policyID ?? '-1'; const accountingMethod = policy?.connections?.netsuite?.options?.config?.accountingMethod; + const pendingAction = + settingsPendingAction([CONST.NETSUITE_CONFIG.AUTO_SYNC], autoSyncConfig?.pendingFields) ?? settingsPendingAction([CONST.NETSUITE_CONFIG.ACCOUNTING_METHOD], config?.pendingFields); return ( Policy.clearNetSuiteAutoSyncErrorField(policyID)} onToggle={(isEnabled) => Connections.updateNetSuiteAutoSync(policyID, isEnabled)} - pendingAction={ - settingsPendingAction([CONST.NETSUITE_CONFIG.AUTO_SYNC], autoSyncConfig?.pendingFields) ?? - settingsPendingAction([CONST.NETSUITE_CONFIG.ACCOUNTING_METHOD], config?.pendingFields) - } + pendingAction={pendingAction} errors={ErrorUtils.getLatestErrorField(autoSyncConfig, CONST.NETSUITE_CONFIG.AUTO_SYNC)} /> {!!autoSyncConfig?.autoSync?.enabled && ( - +