fix(desktop): keep gateway reconnect available on open transports
This commit is contained in:
@@ -71,7 +71,7 @@ describe('GatewayMenuPanel reconnect action', () => {
|
||||
|
||||
afterEach(() => cleanup())
|
||||
|
||||
it('shows reconnect only while disconnected and disables it in flight', async () => {
|
||||
it('shows reconnect while disconnected and disables it in flight', async () => {
|
||||
let finish: (() => void) | undefined
|
||||
mocks.reconnectGateway.mockImplementation(
|
||||
() =>
|
||||
@@ -92,10 +92,12 @@ describe('GatewayMenuPanel reconnect action', () => {
|
||||
await act(async () => finish?.())
|
||||
})
|
||||
|
||||
it('hides reconnect while the socket is open', async () => {
|
||||
it('allows recovery when an open socket stops delivering', async () => {
|
||||
renderPanel('open')
|
||||
await act(async () => undefined)
|
||||
|
||||
expect(screen.queryByRole('button', { name: 'Reconnect gateway' })).toBeNull()
|
||||
const reconnect = screen.getByRole('button', { name: 'Reconnect gateway' })
|
||||
await act(async () => fireEvent.click(reconnect))
|
||||
expect(mocks.reconnectGateway).toHaveBeenCalledOnce()
|
||||
})
|
||||
})
|
||||
|
||||
@@ -171,20 +171,19 @@ export function GatewayMenuPanel({
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex shrink-0 items-center gap-0.5">
|
||||
{!gatewayOpen && (
|
||||
<Tip label={copy.reconnectGateway}>
|
||||
<Button
|
||||
aria-label={copy.reconnectGateway}
|
||||
className="text-muted-foreground hover:text-foreground"
|
||||
disabled={reconnecting}
|
||||
onClick={reconnect}
|
||||
size="icon-xs"
|
||||
variant="ghost"
|
||||
>
|
||||
<RefreshCw className={cn(reconnecting && 'animate-spin')} />
|
||||
</Button>
|
||||
</Tip>
|
||||
)}
|
||||
{/* An open transport can still be wedged; recovery must remain reachable. */}
|
||||
<Tip label={copy.reconnectGateway}>
|
||||
<Button
|
||||
aria-label={copy.reconnectGateway}
|
||||
className="text-muted-foreground hover:text-foreground"
|
||||
disabled={reconnecting}
|
||||
onClick={reconnect}
|
||||
size="icon-xs"
|
||||
variant="ghost"
|
||||
>
|
||||
<RefreshCw className={cn(reconnecting && 'animate-spin')} />
|
||||
</Button>
|
||||
</Tip>
|
||||
<Tip label={copy.openSystem}>
|
||||
<Button
|
||||
aria-label={copy.openSystem}
|
||||
|
||||
Reference in New Issue
Block a user