Skip to content

Commit

Permalink
Add exception for NetSuite in error checking logic
Browse files Browse the repository at this point in the history
  • Loading branch information
yuwenmemon committed Jun 20, 2024
1 parent fee69ea commit a1d5ab1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/libs/actions/connections/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,11 @@ function updateManyPolicyConnectionConfigs<TConnectionName extends ConnectionNam
}

function hasSynchronizationError(policy: OnyxEntry<Policy>, connectionName: PolicyConnectionName, isSyncInProgress: boolean): boolean {
// NetSuite does not use the conventional lastSync object, so we need to check for lastErrorSyncDate
if (connectionName === CONST.POLICY.CONNECTIONS.NAME.NETSUITE) {
return !isSyncInProgress && !!policy?.connections?.[CONST.POLICY.CONNECTIONS.NAME.NETSUITE].lastErrorSyncDate
}

return !isSyncInProgress && policy?.connections?.[connectionName]?.lastSync?.isSuccessful === false;
}

Expand Down

0 comments on commit a1d5ab1

Please sign in to comment.