Skip to content

Commit

Permalink
Merge pull request #42899 from rushatgabhane/xero-err
Browse files Browse the repository at this point in the history
[Wave Collect] [Xero] Don't show error while syncing
  • Loading branch information
lakchote authored May 31, 2024
2 parents 25c5438 + bdc6363 commit 2eb16f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/libs/actions/connections/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ function updateManyPolicyConnectionConfigs<TConnectionName extends ConnectionNam
API.write(WRITE_COMMANDS.UPDATE_MANY_POLICY_CONNECTION_CONFIGS, parameters, {optimisticData, failureData, successData});
}

function hasSynchronizationError(policy: OnyxEntry<Policy>, connectionName: PolicyConnectionName): boolean {
return policy?.connections?.[connectionName]?.lastSync?.isSuccessful === false;
function hasSynchronizationError(policy: OnyxEntry<Policy>, connectionName: PolicyConnectionName, isSyncInProgress: boolean): boolean {
return !isSyncInProgress && policy?.connections?.[connectionName]?.lastSync?.isSuccessful === false;
}

export {removePolicyConnection, updatePolicyConnectionConfig, updateManyPolicyConnectionConfigs, hasSynchronizationError, syncConnection};
2 changes: 1 addition & 1 deletion src/pages/workspace/accounting/PolicyAccountingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ function PolicyAccountingPage({policy, connectionSyncProgress}: PolicyAccounting
if (!connectedIntegration) {
return [];
}
const shouldShowSynchronizationError = hasSynchronizationError(policy, connectedIntegration);
const shouldShowSynchronizationError = hasSynchronizationError(policy, connectedIntegration, isSyncInProgress);
const integrationData = accountingIntegrationData(connectedIntegration, policyID, translate);
const iconProps = integrationData?.icon ? {icon: integrationData.icon, iconType: CONST.ICON_TYPE_AVATAR} : {};
return [
Expand Down

0 comments on commit 2eb16f4

Please sign in to comment.