diff --git a/src/Expensify.tsx b/src/Expensify.tsx index 458f1e3c5d249..d9287da5aae77 100644 --- a/src/Expensify.tsx +++ b/src/Expensify.tsx @@ -109,9 +109,6 @@ function Expensify({ const isAuthenticated = useMemo(() => !!(session?.authToken ?? null), [session]); const autoAuthState = useMemo(() => session?.autoAuthState ?? '', [session]); - const isAuthenticatedRef = useRef(false); - isAuthenticatedRef.current = isAuthenticated; - const contextValue = useMemo( () => ({ isSplashHidden, @@ -198,8 +195,7 @@ function Expensify({ // Open chat report from a deep link (only mobile native) Linking.addEventListener('url', (state) => { - // We need to pass 'isAuthenticated' to avoid loading a non-existing profile page twice - Report.openReportFromDeepLink(state.url, !isAuthenticatedRef.current); + Report.openReportFromDeepLink(state.url); }); return () => { diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index bcfe3f30f8f47..3d32debbab695 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -2491,7 +2491,7 @@ function toggleEmojiReaction( addEmojiReaction(originalReportID, reportAction.reportActionID, emoji, skinTone); } -function openReportFromDeepLink(url: string, shouldNavigate = true) { +function openReportFromDeepLink(url: string) { const reportID = ReportUtils.getReportIDFromLink(url); const isAuthenticated = Session.hasAuthToken(); @@ -2535,7 +2535,7 @@ function openReportFromDeepLink(url: string, shouldNavigate = true) { return; } - if (!shouldNavigate) { + if (isAuthenticated) { return; } diff --git a/src/libs/actions/Welcome.ts b/src/libs/actions/Welcome.ts index 3f70dc0d962d4..2b25829a5c33e 100644 --- a/src/libs/actions/Welcome.ts +++ b/src/libs/actions/Welcome.ts @@ -78,7 +78,6 @@ function setOnboardingPolicyID(policyID?: string) { Onyx.connect({ key: ONYXKEYS.NVP_ONBOARDING, - initWithStoredValues: false, callback: (value) => { if (value === undefined) { return;