Skip to content

Commit

Permalink
Fix behavior on desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuuszzzzz committed Feb 21, 2025
1 parent df0bb41 commit 69a2d5a
Showing 1 changed file with 23 additions and 24 deletions.
47 changes: 23 additions & 24 deletions src/pages/OnboardingEmployees/BaseOnboardingEmployees.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ function BaseOnboardingEmployees({shouldUseNativeStyles, route}: BaseOnboardingE
}
setOnboardingCompanySize(selectedCompanySize);

// Redirect is disabled on desktop
if (getPlatform() !== CONST.PLATFORM.DESKTOP) {
switchToOldDotOnNonMicroCompanySize(selectedCompanySize); // SHOULD BE DISABLED ON DESKTOP
switchToOldDotOnNonMicroCompanySize(selectedCompanySize);
}

const shouldCreateWorkspace = !onboardingPolicyID && !paidGroupPolicy;
Expand All @@ -92,34 +93,32 @@ function BaseOnboardingEmployees({shouldUseNativeStyles, route}: BaseOnboardingE
setOnboardingPolicyID(policyID);
}

// For MICRO companies (1-10 employees), we want to remain on NewDot.
if (selectedCompanySize === CONST.ONBOARDING_COMPANY_SIZE.MICRO) {
// For MICRO companies (1-10 employees) or desktop app, we want to remain on NewDot.
if (selectedCompanySize === CONST.ONBOARDING_COMPANY_SIZE.MICRO || getPlatform() === CONST.PLATFORM.DESKTOP) {
Navigation.navigate(ROUTES.ONBOARDING_ACCOUNTING.getRoute(route.params?.backTo));
return;
}

if (getPlatform() !== CONST.PLATFORM.DESKTOP) {
// For other company sizes we want to complete onboarding here.
// At this point `onboardingPurposeSelected` should always exist as we set it in `BaseOnboardingPurpose`.
if (onboardingPurposeSelected) {
completeOnboarding(
onboardingPurposeSelected,
CONST.ONBOARDING_MESSAGES[onboardingPurposeSelected],
undefined,
undefined,
adminsChatReportID,
onboardingPolicyID,
undefined,
onboardingCompanySize,
);
}
// For other company sizes we want to complete onboarding here.
// At this point `onboardingPurposeSelected` should always exist as we set it in `BaseOnboardingPurpose`.
if (onboardingPurposeSelected) {
completeOnboarding(
onboardingPurposeSelected,
CONST.ONBOARDING_MESSAGES[onboardingPurposeSelected],
undefined,
undefined,
adminsChatReportID,
onboardingPolicyID,
undefined,
onboardingCompanySize,
);
}

if (NativeModules.HybridAppModule) {
NativeModules.HybridAppModule.closeReactNativeApp(false, true);
setRootStatusBarEnabled(false);
} else {
openOldDotLink(CONST.OLDDOT_URLS.INBOX, true); // SHOULD BE DISABLED ON DESKTOP
}
if (NativeModules.HybridAppModule) {
NativeModules.HybridAppModule.closeReactNativeApp(false, true);
setRootStatusBarEnabled(false);
} else {
openOldDotLink(CONST.OLDDOT_URLS.INBOX, true);
}
}}
pressOnEnter
Expand Down

0 comments on commit 69a2d5a

Please sign in to comment.