mirror of
https://github.com/dergigi/boris.git
synced 2025-12-22 17:14:20 +01:00
refactor: remove redundant isLocalOnly flag
- Remove isLocalOnly field from Highlight type and creation logic - Use only isOfflineCreated flag for flight mode highlights - Simplify UI logic to check only isOfflineCreated - Both flags were set to the same value, making them redundant - Cleaner, more maintainable code with single source of truth
This commit is contained in:
@@ -307,7 +307,7 @@ export const HighlightItem: React.FC<HighlightItemProps> = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if this highlight was created offline (flight mode)
|
// Check if this highlight was created offline (flight mode)
|
||||||
const isOfflineCreated = highlight.isOfflineCreated || highlight.isLocalOnly
|
const isOfflineCreated = highlight.isOfflineCreated
|
||||||
|
|
||||||
// Show highlighter icon with relay info if available
|
// Show highlighter icon with relay info if available
|
||||||
if (highlight.publishedRelays && highlight.publishedRelays.length > 0) {
|
if (highlight.publishedRelays && highlight.publishedRelays.length > 0) {
|
||||||
|
|||||||
@@ -135,7 +135,6 @@ export async function createHighlight(
|
|||||||
// 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)
|
||||||
highlight.publishedRelays = expectedSuccessRelays
|
highlight.publishedRelays = expectedSuccessRelays
|
||||||
highlight.isLocalOnly = isLocalOnly
|
|
||||||
highlight.isOfflineCreated = isLocalOnly
|
highlight.isOfflineCreated = isLocalOnly
|
||||||
|
|
||||||
return highlight
|
return highlight
|
||||||
|
|||||||
@@ -15,10 +15,9 @@ export interface Highlight {
|
|||||||
comment?: string // optional comment about the highlight
|
comment?: string // optional comment about the highlight
|
||||||
// Level classification (computed based on user's context)
|
// Level classification (computed based on user's context)
|
||||||
level?: HighlightLevel
|
level?: HighlightLevel
|
||||||
// Relay tracking for offline/local-only highlights
|
// Relay tracking for offline highlights
|
||||||
publishedRelays?: string[] // URLs of relays where this was published (for user-created 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
|
seenOnRelays?: string[] // URLs of relays where this event was fetched from
|
||||||
isLocalOnly?: boolean // true if only published to local relays
|
|
||||||
isOfflineCreated?: boolean // true if created while in flight mode (offline)
|
isOfflineCreated?: boolean // true if created while in flight mode (offline)
|
||||||
isSyncing?: boolean // true if currently being synced to remote relays
|
isSyncing?: boolean // true if currently being synced to remote relays
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user