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 (