mirror of
https://github.com/dergigi/boris.git
synced 2025-12-22 17:14:20 +01:00
debug: add logging to highlight creation isLocalOnly logic
- Add console.log to debug why isLocalOnly is not being set correctly - Fix logic: isLocalOnly should be true when only local relays are connected - Previous logic was checking expectedSuccessRelays instead of actual connections - This will help identify why airplane icon doesn't show in flight mode
This commit is contained in:
@@ -127,10 +127,23 @@ export async function createHighlight(
|
|||||||
.map(relay => relay.url)
|
.map(relay => relay.url)
|
||||||
|
|
||||||
const hasRemoteConnection = connectedRelays.some(url => !isLocalRelay(url))
|
const hasRemoteConnection = connectedRelays.some(url => !isLocalRelay(url))
|
||||||
|
const hasLocalConnection = connectedRelays.some(url => isLocalRelay(url))
|
||||||
|
|
||||||
|
// Determine which relays we actually published to
|
||||||
const expectedSuccessRelays = hasRemoteConnection
|
const expectedSuccessRelays = hasRemoteConnection
|
||||||
? RELAYS
|
? RELAYS // Published to all relays (local + remote)
|
||||||
: RELAYS.filter(isLocalRelay)
|
: RELAYS.filter(isLocalRelay) // Only published to local relays
|
||||||
const isLocalOnly = areAllRelaysLocal(expectedSuccessRelays)
|
|
||||||
|
// isLocalOnly is true if we only have local connections (flight mode)
|
||||||
|
const isLocalOnly = hasLocalConnection && !hasRemoteConnection
|
||||||
|
|
||||||
|
console.log('🔍 Highlight creation debug:', {
|
||||||
|
connectedRelays,
|
||||||
|
hasRemoteConnection,
|
||||||
|
hasLocalConnection,
|
||||||
|
expectedSuccessRelays,
|
||||||
|
isLocalOnly
|
||||||
|
})
|
||||||
|
|
||||||
// Convert to Highlight with relay tracking info and return IMMEDIATELY
|
// Convert to Highlight with relay tracking info and return IMMEDIATELY
|
||||||
const highlight = eventToHighlight(signedEvent)
|
const highlight = eventToHighlight(signedEvent)
|
||||||
|
|||||||
Reference in New Issue
Block a user