From cb452abe800de30024ae5f52f2906041816f432e Mon Sep 17 00:00:00 2001 From: optrader Date: Fri, 21 Nov 2025 05:01:35 +0900 Subject: [PATCH] [251121] fix: Popular show video load MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🕐 커밋 시간: 2025. 11. 21. 05:01:35 📊 변경 통계: • 총 파일: 1개 • 추가: +30줄 • 삭제: -25줄 📝 수정된 파일: ~ com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx 🔧 주요 변경 내용: • 소규모 기능 개선 • 코드 정리 및 최적화 --- .../src/views/PlayerPanel/PlayerPanel.jsx | 55 ++++++++++--------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx index 9a651d53..267c27d9 100644 --- a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx +++ b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx @@ -1145,33 +1145,37 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props ]); useEffect(() => { - if ( - panelInfo.shptmBanrTpNm === 'VOD' && - showDetailInfo && - showDetailInfo.length > 0 && - showDetailInfo[0]?.showCatCd && - fullVideolgCatCd !== showDetailInfo[0]?.showCatCd //기존에 호출했으면 안한다. - ) { - dispatch( - getHomeFullVideoInfo({ - lgCatCd: showDetailInfo[0].showCatCd, - }) - ); - } - if ( - panelInfo.shptmBanrTpNm === 'VOD' && - showDetailInfo && - showDetailInfo[0] && - showDetailInfo[0].showId && - showDetailInfo[0].patnrId - ) { - if (!featuredShowsInfos || Object.keys(featuredShowsInfos).length === 0) { - setPlayListInfo(showDetailInfo); + if (panelInfo.shptmBanrTpNm === 'VOD' && showDetailInfo && showDetailInfo.length > 0) { + // 현재 panelInfo의 showId와 showDetailInfo의 showId가 일치할 때만 처리 + if (showDetailInfo[0]?.showId === panelInfo.showId) { + if (showDetailInfo[0]?.showCatCd && fullVideolgCatCd !== showDetailInfo[0]?.showCatCd) { + dispatch( + getHomeFullVideoInfo({ + lgCatCd: showDetailInfo[0].showCatCd, + }) + ); + } + if (showDetailInfo[0].showId && showDetailInfo[0].patnrId) { + if (!featuredShowsInfos || Object.keys(featuredShowsInfos).length === 0) { + setPlayListInfo(showDetailInfo); + // VOD는 단일 비디오이므로 selectedIndex를 0으로 고정 + setSelectedIndex(0); + } + setShopNowInfo(showDetailInfo[0].productInfos); + saveToLocalSettings(showDetailInfo[0].showId, showDetailInfo[0].patnrId); + } + } else { + // showId가 일치하지 않으면 이전 상태를 재활용하지 않고 초기화 + console.log('[PlayerPanel] VOD showDetailInfo mismatch. Clearing playListInfo.', { + panelInfoShowId: panelInfo.showId, + showDetailInfoId: showDetailInfo[0]?.showId, + }); + setPlayListInfo(null); + setSelectedIndex(null); + setShopNowInfo(null); } - setShopNowInfo(showDetailInfo[0].productInfos); - saveToLocalSettings(showDetailInfo[0].showId, showDetailInfo[0].patnrId); } - }, [showDetailInfo]); + }, [showDetailInfo, panelInfo.showId, panelInfo.shptmBanrTpNm, fullVideolgCatCd, featuredShowsInfos]); //LIVE useEffect(() => { @@ -2402,6 +2406,7 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props > {isReadyToPlay && (