From 1c6bfc02fb9da56281bdc449a951725fb2ec808d Mon Sep 17 00:00:00 2001
From: dan <dan.abramov@gmail.com>
Date: Thu, 4 Jul 2024 21:15:47 +0100
Subject: Fix order of checks in experiment (#4734)

---
 src/view/shell/createNativeStackNavigatorWithAuth.tsx | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

(limited to 'src/view/shell/createNativeStackNavigatorWithAuth.tsx')

diff --git a/src/view/shell/createNativeStackNavigatorWithAuth.tsx b/src/view/shell/createNativeStackNavigatorWithAuth.tsx
index 82dd6d22c..203e7e507 100644
--- a/src/view/shell/createNativeStackNavigatorWithAuth.tsx
+++ b/src/view/shell/createNativeStackNavigatorWithAuth.tsx
@@ -102,10 +102,11 @@ function NativeStackNavigator({
   const {showLoggedOut} = useLoggedOutView()
   const {setShowLoggedOut} = useLoggedOutViewControls()
   const {isMobile, isTabletOrMobile} = useWebMediaQueries()
-  const isNativePWIDisabled = isNative && gate('native_pwi_disabled')
   if (
-    (!PWI_ENABLED || isNativePWIDisabled || activeRouteRequiresAuth) &&
-    !hasSession
+    !hasSession &&
+    (!PWI_ENABLED ||
+      activeRouteRequiresAuth ||
+      (isNative && gate('native_pwi_disabled')))
   ) {
     return <LoggedOut />
   }
-- 
cgit 1.4.1

