fix: manually set highlight properties after eventToHighlight

- Set publishedRelays, isLocalOnly, and isSyncing directly on highlight object
- This bypasses the __highlightProps mechanism which wasn't working
- Add logging to verify properties are set correctly
- This should finally fix the airplane icon not showing in flight mode
This commit is contained in:
Gigi
2025-10-30 21:01:18 +01:00
parent 389b4de0eb
commit 49872337f3

View File

@@ -213,15 +213,23 @@ export async function createHighlight(
markEventAsOfflineCreated(signedEvent.id)
}
// Convert to Highlight with relay tracking info and return IMMEDIATELY
console.log('🔄 [HIGHLIGHT-CREATION] About to convert event to highlight:', {
eventId: signedEvent.id,
hasHighlightProps: !!(signedEvent as any).__highlightProps,
highlightProps: (signedEvent as any).__highlightProps
})
// Convert to Highlight with relay tracking info
const highlight = eventToHighlight(signedEvent)
// Manually set the properties since __highlightProps might not be working
highlight.publishedRelays = publishResponses
.filter(response => response.ok)
.map(response => response.from)
highlight.isLocalOnly = isLocalOnly
highlight.isSyncing = false
console.log('🔄 [HIGHLIGHT-CREATION] Final highlight properties set:', {
eventId: signedEvent.id,
publishedRelays: highlight.publishedRelays,
isLocalOnly: highlight.isLocalOnly,
isSyncing: highlight.isSyncing
})
return highlight
}