MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / handleReconnect

Function handleReconnect

ui/src/components/ReconnectButton.tsx:11–28  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9 useEffect(() => () => { if (timerRef.current) clearTimeout(timerRef.current) }, [])
10
11 const handleReconnect = async () => {
12 setStatus('loading')
13 setMessage('')
14 try {
15 const result = await api.trading.reconnectUTA(accountId)
16 if (result.success) {
17 setStatus('success')
18 setMessage(result.message || 'Connected')
19 timerRef.current = setTimeout(() => setStatus('idle'), 3000)
20 } else {
21 setStatus('error')
22 setMessage(result.error || 'Connection failed')
23 }
24 } catch (err) {
25 setStatus('error')
26 setMessage(err instanceof Error ? err.message : 'Connection failed')
27 }
28 }
29
30 // No outer margin here — spacing belongs to the call site (this rides in
31 // the page-header action row AND in the edit dialog; a baked-in mt-3 was

Callers

nothing calls this directly

Calls 1

reconnectUTAMethod · 0.45

Tested by

no test coverage detected