avoid stale e2e proxy input state
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import {useState} from 'react'
|
import {useRef, useState} from 'react'
|
||||||
import {Keyboard, LogBox, Pressable, TextInput, View} from 'react-native'
|
import {Keyboard, LogBox, Pressable, TextInput, View} from 'react-native'
|
||||||
import {useQueryClient} from '@tanstack/react-query'
|
import {useQueryClient} from '@tanstack/react-query'
|
||||||
|
|
||||||
@@ -61,9 +61,9 @@ export function TestCtrls() {
|
|||||||
)
|
)
|
||||||
setShowLoggedOut(false)
|
setShowLoggedOut(false)
|
||||||
}
|
}
|
||||||
const [proxyHeader, setProxyHeader] = useState('')
|
const proxyHeader = useRef('')
|
||||||
const configureProxy = () => {
|
const configureProxy = () => {
|
||||||
const header = `${proxyHeader}#bsky_appview`
|
const header = `${proxyHeader.current}#bsky_appview`
|
||||||
BLUESKY_PROXY_HEADER.set(header)
|
BLUESKY_PROXY_HEADER.set(header)
|
||||||
agent.configureProxy(header as any)
|
agent.configureProxy(header as any)
|
||||||
hasConfiguredProxy = true
|
hasConfiguredProxy = true
|
||||||
@@ -76,7 +76,9 @@ export function TestCtrls() {
|
|||||||
accessibilityLabel="Text input field"
|
accessibilityLabel="Text input field"
|
||||||
accessibilityHint="Enter proxy header"
|
accessibilityHint="Enter proxy header"
|
||||||
testID="e2eProxyHeaderInput"
|
testID="e2eProxyHeaderInput"
|
||||||
onChangeText={val => setProxyHeader(val)}
|
onChangeText={val => {
|
||||||
|
proxyHeader.current = val
|
||||||
|
}}
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
autoCorrect={false}
|
autoCorrect={false}
|
||||||
autoCapitalize="none"
|
autoCapitalize="none"
|
||||||
|
|||||||
Reference in New Issue
Block a user