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.
This commit is contained in:
Gigi
2025-10-09 16:51:10 +01:00
parent 1134a41192
commit 4cd54834ce

View File

@@ -60,15 +60,26 @@ export const HighlightItem: React.FC<HighlightItemProps> = ({
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) {