From 4cd54834ceeac44b5f51c1c2ade209d158f392ee Mon Sep 17 00:00:00 2001 From: Gigi Date: Thu, 9 Oct 2025 16:51:10 +0100 Subject: [PATCH] fix(highlights): update relay info after automatic sync completes When offline sync completes successfully, update the highlight's publishedRelays to show all relays and change icon from plane to server. Previously only manual rebroadcast updated this info. --- src/components/HighlightItem.tsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/components/HighlightItem.tsx b/src/components/HighlightItem.tsx index 3727c578..18cc92b1 100644 --- a/src/components/HighlightItem.tsx +++ b/src/components/HighlightItem.tsx @@ -60,15 +60,26 @@ export const HighlightItem: React.FC = ({ const unsubscribe = onSyncStateChange((eventId, syncingState) => { if (eventId === highlight.id) { setIsSyncing(syncingState) - // Hide offline indicator when sync completes successfully + // When sync completes successfully, update highlight to show all relays if (!syncingState) { setShowOfflineIndicator(false) + + // Update the highlight with all relays after successful sync + if (onHighlightUpdate && highlight.isLocalOnly) { + const updatedHighlight = { + ...highlight, + publishedRelays: RELAYS, + isLocalOnly: false, + isOfflineCreated: false + } + onHighlightUpdate(updatedHighlight) + } } } }) return unsubscribe - }, [highlight.id]) + }, [highlight, onHighlightUpdate]) useEffect(() => { if (isSelected && itemRef.current) {