()
| 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 |
nothing calls this directly
no test coverage detected