Skip to content

Commit

Permalink
refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhenjaHorbach committed Oct 16, 2024
1 parent 210fa09 commit ae08042
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/pages/workspace/accounting/AccountingContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion src/pages/workspace/accounting/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/workspace/accounting/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ae08042

Please sign in to comment.