Skip to content

Commit

Permalink
Merge pull request Expensify#50032 from hungvu193/fix-49752
Browse files Browse the repository at this point in the history
  • Loading branch information
francoisl authored Oct 3, 2024
2 parents 6076570 + 56ca85f commit 96aceca
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
11 changes: 0 additions & 11 deletions src/libs/actions/connections/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,17 +287,6 @@ function updateManyPolicyConnectionConfigs<TConnectionName extends ConnectionNam
}

function hasSynchronizationErrorMessage(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) {
if (
!isSyncInProgress &&
(!!policy?.connections?.[CONST.POLICY.CONNECTIONS.NAME.NETSUITE].lastErrorSyncDate || policy?.connections?.[CONST.POLICY.CONNECTIONS.NAME.NETSUITE]?.verified === false)
) {
return true;
}
return false;
}

const connection = policy?.connections?.[connectionName];

if (isSyncInProgress || isEmptyObject(connection?.lastSync) || connection?.lastSync?.isSuccessful !== false || !connection?.lastSync?.errorDate) {
Expand Down
10 changes: 0 additions & 10 deletions src/pages/workspace/accounting/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -274,16 +274,6 @@ function getSynchronizationErrorMessage(
}

const syncError = Localize.translateLocal('workspace.accounting.syncError', {connectionName});
// NetSuite does not use the conventional lastSync object, so we need to check for lastErrorSyncDate
if (connectionName === CONST.POLICY.CONNECTIONS.NAME.NETSUITE) {
if (
!isSyncInProgress &&
(!!policy?.connections?.[CONST.POLICY.CONNECTIONS.NAME.NETSUITE].lastErrorSyncDate || policy?.connections?.[CONST.POLICY.CONNECTIONS.NAME.NETSUITE]?.verified === false)
) {
return syncError;
}
return;
}

const connection = policy?.connections?.[connectionName];
if (isSyncInProgress || isEmptyObject(connection?.lastSync) || connection?.lastSync?.isSuccessful !== false || !connection?.lastSync?.errorDate) {
Expand Down

0 comments on commit 96aceca

Please sign in to comment.