Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/libs/OnboardingUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,22 @@ const supportedIntegrationsInNewDot = ['quickbooksOnline', 'quickbooksDesktop',
* @returns boolean - True if user should be redirected to old dot
*/
function shouldOnboardingRedirectToOldDot(companySize: OnboardingCompanySize | undefined, userReportedIntegration: OnboardingAccounting | undefined): boolean {
// Desktop users should never be redirected to old dot
if (getPlatform() === CONST.PLATFORM.DESKTOP) {
return false;
}

// Check if the integration is supported in NewDot
const isSupportedIntegration = (!!userReportedIntegration && supportedIntegrationsInNewDot.includes(userReportedIntegration)) || userReportedIntegration === null;
return getPlatform() !== CONST.PLATFORM.DESKTOP && (!isSupportedIntegration || companySize !== CONST.ONBOARDING_COMPANY_SIZE.MICRO);

// Don't redirect if integration is supported and company size is MICRO or SMALL
const isMicroOrSmallCompany = companySize === CONST.ONBOARDING_COMPANY_SIZE.MICRO || companySize === CONST.ONBOARDING_COMPANY_SIZE.SMALL;
if (isSupportedIntegration && isMicroOrSmallCompany) {
return false;
}

// Redirect to old dot in all other cases (unsupported integration or larger company size)
return true;
}

// eslint-disable-next-line import/prefer-default-export
Expand Down
Loading