diff --git a/packages/app/app/studio/[organization]/clips/page.tsx b/packages/app/app/studio/[organization]/clips/page.tsx index 218fdd993..a2c82b86d 100644 --- a/packages/app/app/studio/[organization]/clips/page.tsx +++ b/packages/app/app/studio/[organization]/clips/page.tsx @@ -176,10 +176,6 @@ const EventClips = async ({ params, searchParams }: ClipsPageParams) => { return undefined; })(); - if (!previewAsset) { - return notFound(); - } - return ( {previewAsset && ( diff --git a/packages/app/components/misc/VideoCard/VideoCardWithMenu.tsx b/packages/app/components/misc/VideoCard/VideoCardWithMenu.tsx index bde85f379..df7cc60c7 100644 --- a/packages/app/components/misc/VideoCard/VideoCardWithMenu.tsx +++ b/packages/app/components/misc/VideoCard/VideoCardWithMenu.tsx @@ -12,7 +12,7 @@ import { IExtendedSession } from '@/lib/types'; import { formatDate } from '@/lib/utils/time'; import { EllipsisVertical } from 'lucide-react'; import Link from 'next/link'; -import React, { ReactNode } from 'react'; +import React, { ReactNode, useMemo } from 'react'; import { useEffect, useState } from 'react'; const VideoCardWithMenu = ({ @@ -27,7 +27,7 @@ const VideoCardWithMenu = ({ link: string; }) => { const [thumbnail, setThumbnail] = useState(undefined); - + const memoizedSession = useMemo(() => session, []); useEffect(() => { const getThumbnail = async (session: IExtendedSession) => { try { @@ -38,10 +38,10 @@ const VideoCardWithMenu = ({ } }; - if (session) { - getThumbnail(session); + if (memoizedSession && !memoizedSession.coverImage) { + getThumbnail(memoizedSession); } - }, [session]); + }, [memoizedSession]); return (
diff --git a/packages/app/lib/services/sessionService.ts b/packages/app/lib/services/sessionService.ts index e7d0845da..ab8dfdbb2 100644 --- a/packages/app/lib/services/sessionService.ts +++ b/packages/app/lib/services/sessionService.ts @@ -186,7 +186,7 @@ export const fetchSessionMetrics = async ({ const response = await fetch(`${apiUrl()}/streams/metric/${playbackId}`, { cache: 'no-store', }); - console.log('response', response); + if (!response.ok) { return { viewCount: 0,