Add native_pwi_disabled
feature gate experiment (#4507)
* Add native_pwi_disabled feature gate experiment * Use const
This commit is contained in:
parent
f5f3bd8130
commit
332524b7de
4 changed files with 25 additions and 5 deletions
|
@ -29,7 +29,8 @@ import {
|
|||
useLoggedOutView,
|
||||
useLoggedOutViewControls,
|
||||
} from '#/state/shell/logged-out'
|
||||
import {isWeb} from 'platform/detection'
|
||||
import {useGate} from 'lib/statsig/statsig'
|
||||
import {isNative, isWeb} from 'platform/detection'
|
||||
import {Deactivated} from '#/screens/Deactivated'
|
||||
import {Onboarding} from '#/screens/Onboarding'
|
||||
import {SignupQueued} from '#/screens/SignupQueued'
|
||||
|
@ -50,6 +51,7 @@ function NativeStackNavigator({
|
|||
screenOptions,
|
||||
...rest
|
||||
}: NativeStackNavigatorProps) {
|
||||
const gate = useGate()
|
||||
// --- this is copy and pasted from the original native stack navigator ---
|
||||
const {state, descriptors, navigation, NavigationContent} =
|
||||
useNavigationBuilder<
|
||||
|
@ -100,7 +102,11 @@ function NativeStackNavigator({
|
|||
const {showLoggedOut} = useLoggedOutView()
|
||||
const {setShowLoggedOut} = useLoggedOutViewControls()
|
||||
const {isMobile, isTabletOrMobile} = useWebMediaQueries()
|
||||
if ((!PWI_ENABLED || activeRouteRequiresAuth) && !hasSession) {
|
||||
const isNativePWIDisabled = isNative && gate('native_pwi_disabled')
|
||||
if (
|
||||
(!PWI_ENABLED || isNativePWIDisabled || activeRouteRequiresAuth) &&
|
||||
!hasSession
|
||||
) {
|
||||
return <LoggedOut />
|
||||
}
|
||||
if (hasSession && currentAccount?.signupQueued) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue