From ae0804217f97a5c4b3012b40407f4bc83b651024 Mon Sep 17 00:00:00 2001 From: Yauheni Date: Wed, 16 Oct 2024 15:58:21 +0200 Subject: [PATCH] refactor code --- src/pages/workspace/accounting/AccountingContext.tsx | 2 +- src/pages/workspace/accounting/types.ts | 2 +- src/pages/workspace/accounting/utils.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/workspace/accounting/AccountingContext.tsx b/src/pages/workspace/accounting/AccountingContext.tsx index a298d0135bd4..359fa7c70c1e 100644 --- a/src/pages/workspace/accounting/AccountingContext.tsx +++ b/src/pages/workspace/accounting/AccountingContext.tsx @@ -74,7 +74,7 @@ function AccountingContextProvider({children, policy}: AccountingContextProvider ); const workspaceUpgradeNavigationDetails = accountingIntegrationData?.workspaceUpgradeNavigationDetails; if (workspaceUpgradeNavigationDetails && !isControlPolicy(policy)) { - workspaceUpgradeNavigationDetails.sideEffect?.(); + workspaceUpgradeNavigationDetails.eventBeforeNavigation?.(); Navigation.navigate( ROUTES.WORKSPACE_UPGRADE.getRoute(policyID, workspaceUpgradeNavigationDetails.integrationAlias, workspaceUpgradeNavigationDetails.backToAfterWorkspaceUpgradeRoute), diff --git a/src/pages/workspace/accounting/types.ts b/src/pages/workspace/accounting/types.ts index e05ceae1db3a..c7e392db6311 100644 --- a/src/pages/workspace/accounting/types.ts +++ b/src/pages/workspace/accounting/types.ts @@ -23,7 +23,7 @@ type WorkspaceUpgradeNavigationDetails = { /** Route to redirect to after upgrading the workspace */ backToAfterWorkspaceUpgradeRoute: string; /** Function to call after upgrading the workspace */ - sideEffect?: () => void; + eventBeforeNavigation?: () => void; }; type AccountingIntegration = { diff --git a/src/pages/workspace/accounting/utils.tsx b/src/pages/workspace/accounting/utils.tsx index 1aebb56b30b5..c2c82b15b68e 100644 --- a/src/pages/workspace/accounting/utils.tsx +++ b/src/pages/workspace/accounting/utils.tsx @@ -284,7 +284,7 @@ function getAccountingIntegrationData( subscribedAdvancedSettings: [CONST.QUICKBOOKS_DESKTOP_CONFIG.SHOULD_AUTO_CREATE_VENDOR, CONST.QUICKBOOKS_DESKTOP_CONFIG.AUTO_SYNC], workspaceUpgradeNavigationDetails: { integrationAlias: CONST.UPGRADE_FEATURE_INTRO_MAPPING.quickbooksDesktop.alias, - sideEffect: () => { + eventBeforeNavigation: () => { // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing if (isSmallScreenWidth || integrationToDisconnect) { return;