Skip to content

Commit

Permalink
Merge pull request #54364 from allroundexperts/feat-48189-2
Browse files Browse the repository at this point in the history
[CP Staging] fix - use the session private domain
  • Loading branch information
Julesssss authored Dec 19, 2024
2 parents b59e021 + d7b683d commit 20daba1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/hooks/useOnboardingFlow.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {useEffect} from 'react';
import {NativeModules} from 'react-native';
import {useOnyx} from 'react-native-onyx';
import * as LoginUtils from '@libs/LoginUtils';
import Navigation from '@libs/Navigation/Navigation';
import {hasCompletedGuidedSetupFlowSelector, tryNewDotOnyxSelector} from '@libs/onboardingSelectors';
import Permissions from '@libs/Permissions';
import * as SearchQueryUtils from '@libs/SearchQueryUtils';
import * as Session from '@userActions/Session';
import * as OnboardingFlow from '@userActions/Welcome/OnboardingFlow';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
Expand All @@ -27,8 +27,7 @@ function useOnboardingFlowRouter() {

const [dismissedProductTraining, dismissedProductTrainingMetadata] = useOnyx(ONYXKEYS.NVP_DISMISSED_PRODUCT_TRAINING);

const [session] = useOnyx(ONYXKEYS.SESSION);
const isPrivateDomain = !!session?.email && !LoginUtils.isEmailPublicDomain(session?.email);
const isPrivateDomain = Session.isUserOnPrivateDomain();

const [isSingleNewDotEntry, isSingleNewDotEntryMetadata] = useOnyx(ONYXKEYS.IS_SINGLE_NEW_DOT_ENTRY);
const [allBetas, allBetasMetadata] = useOnyx(ONYXKEYS.BETAS);
Expand Down
5 changes: 2 additions & 3 deletions src/libs/Navigation/NavigationRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import useThemePreference from '@hooks/useThemePreference';
import Firebase from '@libs/Firebase';
import {FSPage} from '@libs/Fullstory';
import Log from '@libs/Log';
import * as LoginUtils from '@libs/LoginUtils';
import {hasCompletedGuidedSetupFlowSelector} from '@libs/onboardingSelectors';
import {getPathFromURL} from '@libs/Url';
import {updateLastVisitedPath} from '@userActions/App';
import * as Session from '@userActions/Session';
import {updateOnboardingLastVisitedPath} from '@userActions/Welcome';
import {getOnboardingInitialPath} from '@userActions/Welcome/OnboardingFlow';
import CONST from '@src/CONST';
Expand Down Expand Up @@ -93,8 +93,7 @@ function NavigationRoot({authenticated, lastVisitedPath, initialUrl, onReady, sh
const {shouldUseNarrowLayout} = useResponsiveLayout();
const {setActiveWorkspaceID} = useActiveWorkspace();
const [user] = useOnyx(ONYXKEYS.USER);
const [session] = useOnyx(ONYXKEYS.SESSION);
const isPrivateDomain = !!session?.email && !LoginUtils.isEmailPublicDomain(session?.email);
const isPrivateDomain = Session.isUserOnPrivateDomain();

const [isOnboardingCompleted = true] = useOnyx(ONYXKEYS.NVP_ONBOARDING, {
selector: hasCompletedGuidedSetupFlowSelector,
Expand Down

0 comments on commit 20daba1

Please sign in to comment.