Update dev env (#8921)
* Update dev-env * Integrate appviewDid value from dev-env * Use correct env value to disable policy update overlay * Remove log
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
||||
type PolicyUpdateState,
|
||||
usePolicyUpdateState,
|
||||
} from '#/components/PolicyUpdateOverlay/usePolicyUpdateState'
|
||||
import {ENV} from '#/env'
|
||||
|
||||
const Context = createContext<{
|
||||
state: PolicyUpdateState
|
||||
@@ -45,8 +46,7 @@ export function Provider({children}: {children?: ReactNode}) {
|
||||
const [isReadyToShowOverlay, setIsReadyToShowOverlay] = useState(false)
|
||||
const state = usePolicyUpdateState({
|
||||
// only enable the policy update overlay in non-test environments
|
||||
enabled:
|
||||
isReadyToShowOverlay && hasSession && process.env.NODE_ENV !== 'test',
|
||||
enabled: isReadyToShowOverlay && hasSession && ENV !== 'e2e',
|
||||
})
|
||||
|
||||
const ctx = useMemo(
|
||||
|
||||
Vendored
+1
-1
@@ -11,7 +11,7 @@ export const RELEASE_VERSION: string =
|
||||
process.env.EXPO_PUBLIC_RELEASE_VERSION || packageJson.version
|
||||
|
||||
/**
|
||||
* The env the app is running in e.g. development, testflight, production
|
||||
* The env the app is running in e.g. development, testflight, production, e2e
|
||||
*/
|
||||
export const ENV: string = process.env.EXPO_PUBLIC_ENV
|
||||
|
||||
|
||||
@@ -214,7 +214,11 @@ export const PUBLIC_STAGING_APPVIEW_DID = 'did:web:api.staging.bsky.dev'
|
||||
|
||||
export const DEV_ENV_APPVIEW = `http://localhost:2584` // always the same
|
||||
|
||||
export const BLUESKY_PROXY_HEADER: ProxyHeaderValue = `${BLUESKY_PROXY_DID}#bsky_appview`
|
||||
// temp hack for e2e - esb
|
||||
export let BLUESKY_PROXY_HEADER: ProxyHeaderValue = `${BLUESKY_PROXY_DID}#bsky_appview`
|
||||
export function setBlueskyProxyHeader(header: ProxyHeaderValue) {
|
||||
BLUESKY_PROXY_HEADER = header
|
||||
}
|
||||
|
||||
export const BLUESKY_SERVICE_HEADERS = {
|
||||
'atproto-proxy': BLUESKY_PROXY_HEADER,
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import {LogBox, Pressable, View} from 'react-native'
|
||||
import {useState} from 'react'
|
||||
import {LogBox, Pressable, View, TextInput} from 'react-native'
|
||||
import {useQueryClient} from '@tanstack/react-query'
|
||||
|
||||
import {setBlueskyProxyHeader} from '#/lib/constants'
|
||||
import {useModalControls} from '#/state/modals'
|
||||
import {useSessionApi} from '#/state/session'
|
||||
import {useSessionApi, useAgent} from '#/state/session'
|
||||
import {useLoggedOutViewControls} from '#/state/shell/logged-out'
|
||||
import {useOnboardingDispatch} from '#/state/shell/onboarding'
|
||||
import {navigate} from '../../../Navigation'
|
||||
@@ -18,6 +20,7 @@ LogBox.ignoreAllLogs()
|
||||
const BTN = {height: 1, width: 1, backgroundColor: 'red'}
|
||||
|
||||
export function TestCtrls() {
|
||||
const agent = useAgent()
|
||||
const queryClient = useQueryClient()
|
||||
const {logoutEveryAccount, login} = useSessionApi()
|
||||
const {openModal} = useModalControls()
|
||||
@@ -45,8 +48,19 @@ export function TestCtrls() {
|
||||
)
|
||||
setShowLoggedOut(false)
|
||||
}
|
||||
const [proxyHeader, setProxyHeader] = useState('')
|
||||
return (
|
||||
<View style={{position: 'absolute', top: 100, right: 0, zIndex: 100}}>
|
||||
<TextInput
|
||||
testID="e2eProxyHeaderInput"
|
||||
onChangeText={val => setProxyHeader(val as any)}
|
||||
onSubmitEditing={() => {
|
||||
const header = `${proxyHeader}#bsky_appview`
|
||||
setBlueskyProxyHeader(header as any)
|
||||
agent.configureProxy(header as any)
|
||||
}}
|
||||
style={BTN}
|
||||
/>
|
||||
<Pressable
|
||||
testID="e2eSignInAlice"
|
||||
onPress={onPressSignInAlice}
|
||||
|
||||
Reference in New Issue
Block a user