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 && (