Skip to content

Commit

Permalink
Do not redirect on desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuuszzzzz committed Feb 21, 2025
1 parent 4c87ec9 commit df0bb41
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 23 deletions.
4 changes: 2 additions & 2 deletions src/libs/actions/Welcome/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {OnboardingPurpose} from '@src/types/onyx';
import type Onboarding from '@src/types/onyx/Onboarding';
import type TryNewDot from '@src/types/onyx/TryNewDot';
import {isEmptyObject} from '@src/types/utils/EmptyObject';
import * as OnboardingFlow from './OnboardingFlow';
import {clearInitialPath} from './OnboardingFlow';

type OnboardingData = Onboarding | undefined;

Expand Down Expand Up @@ -207,7 +207,7 @@ function resetAllChecks() {
});
isLoadingReportData = true;
isOnboardingInProgress = false;
OnboardingFlow.clearInitialPath();
clearInitialPath();
}

function setSelfTourViewed(shouldUpdateOnyxDataOnlyLocally = false) {
Expand Down
48 changes: 27 additions & 21 deletions src/pages/OnboardingEmployees/BaseOnboardingEmployees.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ import Text from '@components/Text';
import useLocalize from '@hooks/useLocalize';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useThemeStyles from '@hooks/useThemeStyles';
import getPlatform from '@libs/getPlatform';
import Navigation from '@libs/Navigation/Navigation';
import {isPaidGroupPolicy} from '@libs/PolicyUtils';
import * as Link from '@userActions/Link';
import {openOldDotLink} from '@userActions/Link';
import {createWorkspace, generatePolicyID} from '@userActions/Policy/Policy';
import {completeOnboarding} from '@userActions/Report';
import {setOnboardingAdminsChatReportID, setOnboardingCompanySize, setOnboardingPolicyID, switchToOldDotOnNonMicroCompanySize} from '@userActions/Welcome';
Expand Down Expand Up @@ -73,7 +74,10 @@ function BaseOnboardingEmployees({shouldUseNativeStyles, route}: BaseOnboardingE
return;
}
setOnboardingCompanySize(selectedCompanySize);
switchToOldDotOnNonMicroCompanySize(selectedCompanySize);

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

const shouldCreateWorkspace = !onboardingPolicyID && !paidGroupPolicy;

Expand All @@ -94,26 +98,28 @@ function BaseOnboardingEmployees({shouldUseNativeStyles, route}: BaseOnboardingE
return;
}

// 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 (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,
);
}

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

0 comments on commit df0bb41

Please sign in to comment.