From f4f61885e6a238560413852323b9121d49ba9d88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B3=A0=EB=8F=99=EC=98=81?= Date: Thu, 26 Dec 2024 15:51:55 +0900 Subject: [PATCH] =?UTF-8?q?[SHOPTIME-3412]=20Full=20Player=20/=20Live=20/?= =?UTF-8?q?=20Live=20Channel=20/=20=EB=8B=A4=EB=A5=B8=20=EB=B0=A9=EC=86=A1?= =?UTF-8?q?=EC=9D=84=20=EC=97=B0=EC=86=8D=EC=9C=BC=EB=A1=9C=20=EA=B3=84?= =?UTF-8?q?=EC=86=8D=20=ED=81=B4=EB=A6=AD=20=ED=95=A0=20=EA=B2=BD=EC=9A=B0?= =?UTF-8?q?=20=EC=9E=A0=EC=8B=9C=20=EB=A9=88=EC=B6=A4=20=ED=98=84=EC=83=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [원인] showId가 같다면 클릭을 하지 않는 로직이 존재하지만 티비로 테스트시 속도 문제로 해당 로직이 정상적인 타이밍에 읽지않는것으로 판단 [대책] 중복으로 클릭이 안되도록 setTimeout을 이용해 로직 추가 --- .../TabContents/FeaturedShowContents.jsx | 15 ++++++++++-- .../TabContents/LiveChannelContents.jsx | 23 ++++++++++++++++--- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContents/FeaturedShowContents.jsx b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContents/FeaturedShowContents.jsx index 6ac5b3a0..b2ee77eb 100644 --- a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContents/FeaturedShowContents.jsx +++ b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContents/FeaturedShowContents.jsx @@ -1,4 +1,4 @@ -import React, { useCallback, useEffect, useMemo } from "react"; +import React, { useCallback, useEffect, useMemo, useRef } from "react"; import { useDispatch } from "react-redux"; @@ -25,7 +25,7 @@ export default function FeaturedShowContents({ handleItemFocus, }) { const dispatch = useDispatch(); - + const isClickBlocked = useRef(false); const handleFocus = useCallback( () => () => { if (handleItemFocus) { @@ -49,6 +49,16 @@ export default function FeaturedShowContents({ } = featuredShowsInfos[index]; const handleItemClick = () => { + //중복클릭방지 + if (isClickBlocked.current) { + return; + } + + isClickBlocked.current = true; + setTimeout(() => { + isClickBlocked.current = false; + }, 600); + if (currentVideoShowId && currentVideoShowId === showId) { return; } @@ -93,6 +103,7 @@ export default function FeaturedShowContents({ currentVideoInfo, currentVideoShowId, videoVerticalVisible, + isClickBlocked, ] ); diff --git a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContents/LiveChannelContents.jsx b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContents/LiveChannelContents.jsx index ac42be41..96ee6460 100644 --- a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContents/LiveChannelContents.jsx +++ b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContents/LiveChannelContents.jsx @@ -1,4 +1,4 @@ -import React, { useCallback, useEffect, useState } from "react"; +import React, { useCallback, useEffect, useRef, useState } from "react"; import { useDispatch } from "react-redux"; @@ -22,7 +22,7 @@ export default function LiveChannelContents({ handleItemFocus, }) { const dispatch = useDispatch(); - + const isClickBlocked = useRef(false); const handleFocus = useCallback( () => () => { if (handleItemFocus) { @@ -51,6 +51,16 @@ export default function LiveChannelContents({ } = liveInfos[index]; const handleItemClick = () => { + //중복클릭방지 + if (isClickBlocked.current) { + return; + } + + isClickBlocked.current = true; + setTimeout(() => { + isClickBlocked.current = false; + }, 600); + if (!showId) return; if (currentVideoShowId && currentVideoShowId === showId) { @@ -100,7 +110,14 @@ export default function LiveChannelContents({ /> ); }, - [liveInfos, currentTime, currentVideoShowId, dispatch, handleFocus] + [ + liveInfos, + currentTime, + currentVideoShowId, + isClickBlocked, + dispatch, + handleFocus, + ] ); return (