avoid stale e2e proxy input state

This commit is contained in:
Samuel Newman
2026-07-28 10:43:04 +03:00
parent fb40a4fd3b
commit ca484abdcf
+6 -4
View File
@@ -1,4 +1,4 @@
import {useState} from 'react'
import {useRef, useState} from 'react'
import {Keyboard, LogBox, Pressable, TextInput, View} from 'react-native'
import {useQueryClient} from '@tanstack/react-query'
@@ -61,9 +61,9 @@ export function TestCtrls() {
)
setShowLoggedOut(false)
}
const [proxyHeader, setProxyHeader] = useState('')
const proxyHeader = useRef('')
const configureProxy = () => {
const header = `${proxyHeader}#bsky_appview`
const header = `${proxyHeader.current}#bsky_appview`
BLUESKY_PROXY_HEADER.set(header)
agent.configureProxy(header as any)
hasConfiguredProxy = true
@@ -76,7 +76,9 @@ export function TestCtrls() {
accessibilityLabel="Text input field"
accessibilityHint="Enter proxy header"
testID="e2eProxyHeaderInput"
onChangeText={val => setProxyHeader(val)}
onChangeText={val => {
proxyHeader.current = val
}}
autoComplete="off"
autoCorrect={false}
autoCapitalize="none"