fix: check actual relay connection status instead of pool membership

- Check relay.connected property to determine if relay is actually connected
- Previously only checked if relay was in pool, not if connection was active
- Add debug logging to help diagnose connection status issues
- This should fix the airplane indicator not showing when offline
- Relays should now correctly show as disconnected after being offline
This commit is contained in:
Gigi
2025-10-09 13:29:43 +01:00
parent 19595d19ca
commit d090b953bf
2 changed files with 44 additions and 13 deletions

View File

@@ -25,6 +25,18 @@ export const RelayStatusIndicator: React.FC<RelayStatusIndicatorProps> = ({ rela
const localOnlyMode = hasLocalRelay && !hasRemoteRelay
const offlineMode = connectedUrls.length === 0
// Debug logging
React.useEffect(() => {
if (localOnlyMode || offlineMode) {
console.log('✈️ Relay Status Indicator:', {
mode: offlineMode ? 'OFFLINE' : 'LOCAL_ONLY',
connectedUrls,
hasLocalRelay,
hasRemoteRelay
})
}
}, [localOnlyMode, offlineMode, connectedUrls.length])
// Don't show indicator when fully connected
if (!localOnlyMode && !offlineMode) return null