From 0cf19d4e64331796612de346892983695a2baec6 Mon Sep 17 00:00:00 2001 From: Reynaldi Chernando Date: Thu, 5 Dec 2024 02:04:54 +0700 Subject: [PATCH] Do nothing if current video --- components/Main.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/Main.tsx b/components/Main.tsx index 155a9c7..0aadf8e 100644 --- a/components/Main.tsx +++ b/components/Main.tsx @@ -132,6 +132,11 @@ export default function Main() { }; const handleSelectVideo = async (video: Video) => { + if (video.id === currentVideo?.id) { + setCurrentView("detail"); + return; + } + try { const { videoUrl, audioUrl } = await getMedia(video.id, video.title); setVideoSrc(videoUrl);