From 742360c04d5e09d6404922dfc49100351048d1bc Mon Sep 17 00:00:00 2001 From: "opacity@t-win.kr" Date: Tue, 28 Oct 2025 13:40:38 +0900 Subject: [PATCH] =?UTF-8?q?=ED=94=8C=EB=A0=88=EC=9D=B4=EC=96=B4=20?= =?UTF-8?q?=EB=9D=BC=EC=9D=B4=EB=B8=8C=20=EC=9E=90=EB=8F=99=EC=9E=AC?= =?UTF-8?q?=EC=83=9D=EB=AA=A9=EB=A1=9D=20=EC=88=9C=EC=84=9C=20=EC=A0=95?= =?UTF-8?q?=EB=A0=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/PlayerPanel/PlayerPanel.jsx | 29 +++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx index 17e96d97..2f3d97dd 100644 --- a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx +++ b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx @@ -322,6 +322,7 @@ const PlayerPanel = ({ const mediaLogParamsRef = useRef(null); const prevNowMenuRef = useRef(null); const watchInterval = useRef(null); + const liveShowEndCalledRef = useRef(false); const currentLiveShowInfo = useMemo(() => { if (liveShowInfos && liveShowInfos.length > 0) { @@ -1087,7 +1088,6 @@ const PlayerPanel = ({ }, [ dispatch, panelInfo?.curationId, - panelInfo?.lgCatCd, panelInfo?.patnrId, panelInfo?.showId, panelInfo?.shptmBanrTpNm, @@ -1272,7 +1272,21 @@ const PlayerPanel = ({ playlist.forEach((item) => { if (item.showType === "vod" && Array.isArray(item.vodInfos)) { - const mergedVodInfos = item.vodInfos.map((vod) => ({ + // vodInfos를 정렬 (showId 기준) + const sortedVodInfos = [...item.vodInfos].sort((a, b) => { + // showId가 있으면 showId로 정렬 + if (a.showId && b.showId) { + return a.showId.localeCompare(b.showId); + } + // strtDt가 있으면 시작일로 정렬 + if (a.strtDt && b.strtDt) { + return new Date(a.strtDt) - new Date(b.strtDt); + } + // 정렬 기준이 없으면 원래 순서 유지 + return 0; + }); + + const mergedVodInfos = sortedVodInfos.map((vod) => ({ ...vod, patnrId: item.patnrId, patncNm: item.patncNm, @@ -1402,8 +1416,17 @@ const PlayerPanel = ({ } }, [liveTotalTime]); + // showId 변경 시 liveShowEndCalled 리셋 useEffect(() => { - if (currentLiveTimeSeconds > liveTotalTime) { + liveShowEndCalledRef.current = false; + }, [panelInfo?.showId]); + + useEffect(() => { + if ( + currentLiveTimeSeconds > liveTotalTime && + !liveShowEndCalledRef.current + ) { + liveShowEndCalledRef.current = true; setTimeout(() => { dispatch(getMainLiveShow()); setShopNowInfo("");