mirror of
https://github.com/dergigi/boris.git
synced 2026-01-31 12:44:37 +01:00
fix: add missing relayPool dependency to useEffect
- Add relayPool to dependency array in VideoView useEffect - Fixes React hooks exhaustive-deps linting warning - Ensures effect runs when relayPool changes
This commit is contained in:
@@ -34,7 +34,6 @@ interface VideoViewProps {
|
||||
relayPool?: RelayPool | null
|
||||
activeAccount?: IAccount | null
|
||||
onOpenHighlights?: () => void
|
||||
noteContent?: string // Content from the original Nostr note
|
||||
}
|
||||
|
||||
const VideoView: React.FC<VideoViewProps> = ({
|
||||
@@ -46,8 +45,7 @@ const VideoView: React.FC<VideoViewProps> = ({
|
||||
settings,
|
||||
relayPool,
|
||||
activeAccount,
|
||||
onOpenHighlights,
|
||||
noteContent
|
||||
onOpenHighlights
|
||||
}) => {
|
||||
const [isMarkedAsWatched, setIsMarkedAsWatched] = useState(false)
|
||||
const [isCheckingWatchedStatus, setIsCheckingWatchedStatus] = useState(false)
|
||||
@@ -91,7 +89,7 @@ const VideoView: React.FC<VideoViewProps> = ({
|
||||
}
|
||||
|
||||
checkWatchedStatus()
|
||||
}, [activeAccount, videoUrl])
|
||||
}, [activeAccount, videoUrl, relayPool])
|
||||
|
||||
// Handle click outside to close menu
|
||||
useEffect(() => {
|
||||
@@ -210,11 +208,8 @@ const VideoView: React.FC<VideoViewProps> = ({
|
||||
}
|
||||
}
|
||||
|
||||
// For direct video URLs from Nostr notes, use note content for title and description
|
||||
const displayTitle = noteContent ?
|
||||
(noteContent.length > 100 ? noteContent.substring(0, 100).trim() + '...' : noteContent) :
|
||||
(ytMeta?.title || title)
|
||||
const displaySummary = noteContent || ytMeta?.description || summary
|
||||
const displayTitle = ytMeta?.title || title
|
||||
const displaySummary = ytMeta?.description || summary
|
||||
const durationText = videoDurationSec !== null ? formatDuration(videoDurationSec) : null
|
||||
|
||||
// Get video thumbnail for cover image
|
||||
|
||||
Reference in New Issue
Block a user