mirror of
https://github.com/dergigi/boris.git
synced 2025-12-24 01:54:19 +01:00
refactor: use isLocalOnly instead of isOfflineCreated
- isLocalOnly is more accurate - covers both offline and online-but-local-only scenarios - Update tooltip to 'Local relays only - will sync when remote relays available' - Better semantic meaning: highlights only published to local relays - Covers cases where user is online but only connected to local relays
This commit is contained in:
@@ -306,8 +306,8 @@ export const HighlightItem: React.FC<HighlightItemProps> = ({
|
||||
}
|
||||
}
|
||||
|
||||
// Check if this highlight was created offline (flight mode)
|
||||
const isOfflineCreated = highlight.isOfflineCreated
|
||||
// Check if this highlight was only published to local relays
|
||||
const isLocalOnly = highlight.isLocalOnly
|
||||
|
||||
// Show highlighter icon with relay info if available
|
||||
if (highlight.publishedRelays && highlight.publishedRelays.length > 0) {
|
||||
@@ -315,8 +315,8 @@ export const HighlightItem: React.FC<HighlightItemProps> = ({
|
||||
url.replace(/^wss?:\/\//, '').replace(/\/$/, '')
|
||||
)
|
||||
return {
|
||||
icon: isOfflineCreated ? faPlane : faHighlighter,
|
||||
tooltip: isOfflineCreated ? 'Created offline - will sync when online' : relayNames.join('\n'),
|
||||
icon: isLocalOnly ? faPlane : faHighlighter,
|
||||
tooltip: isLocalOnly ? 'Local relays only - will sync when remote relays available' : relayNames.join('\n'),
|
||||
spin: false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ export async function createHighlight(
|
||||
// Convert to Highlight with relay tracking info and return IMMEDIATELY
|
||||
const highlight = eventToHighlight(signedEvent)
|
||||
highlight.publishedRelays = expectedSuccessRelays
|
||||
highlight.isOfflineCreated = isLocalOnly
|
||||
highlight.isLocalOnly = isLocalOnly
|
||||
|
||||
return highlight
|
||||
}
|
||||
|
||||
@@ -15,10 +15,10 @@ export interface Highlight {
|
||||
comment?: string // optional comment about the highlight
|
||||
// Level classification (computed based on user's context)
|
||||
level?: HighlightLevel
|
||||
// Relay tracking for offline highlights
|
||||
// Relay tracking for local-only highlights
|
||||
publishedRelays?: string[] // URLs of relays where this was published (for user-created highlights)
|
||||
seenOnRelays?: string[] // URLs of relays where this event was fetched from
|
||||
isOfflineCreated?: boolean // true if created while in flight mode (offline)
|
||||
isLocalOnly?: boolean // true if only published to local relays
|
||||
isSyncing?: boolean // true if currently being synced to remote relays
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user