[251121] fix: Popular show video load

🕐 커밋 시간: 2025. 11. 21. 05:01:35

📊 변경 통계:
  • 총 파일: 1개
  • 추가: +30줄
  • 삭제: -25줄

📝 수정된 파일:
  ~ com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx

🔧 주요 변경 내용:
  • 소규모 기능 개선
  • 코드 정리 및 최적화
This commit is contained in:
2025-11-21 05:01:35 +09:00
parent 3cc84ace17
commit cb452abe80

View File

@@ -1145,33 +1145,37 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props
]); ]);
useEffect(() => { useEffect(() => {
if ( if (panelInfo.shptmBanrTpNm === 'VOD' && showDetailInfo && showDetailInfo.length > 0) {
panelInfo.shptmBanrTpNm === 'VOD' && // 현재 panelInfo의 showId와 showDetailInfo의 showId가 일치할 때만 처리
showDetailInfo && if (showDetailInfo[0]?.showId === panelInfo.showId) {
showDetailInfo.length > 0 && if (showDetailInfo[0]?.showCatCd && fullVideolgCatCd !== showDetailInfo[0]?.showCatCd) {
showDetailInfo[0]?.showCatCd &&
fullVideolgCatCd !== showDetailInfo[0]?.showCatCd //기존에 호출했으면 안한다.
) {
dispatch( dispatch(
getHomeFullVideoInfo({ getHomeFullVideoInfo({
lgCatCd: showDetailInfo[0].showCatCd, lgCatCd: showDetailInfo[0].showCatCd,
}) })
); );
} }
if ( if (showDetailInfo[0].showId && showDetailInfo[0].patnrId) {
panelInfo.shptmBanrTpNm === 'VOD' &&
showDetailInfo &&
showDetailInfo[0] &&
showDetailInfo[0].showId &&
showDetailInfo[0].patnrId
) {
if (!featuredShowsInfos || Object.keys(featuredShowsInfos).length === 0) { if (!featuredShowsInfos || Object.keys(featuredShowsInfos).length === 0) {
setPlayListInfo(showDetailInfo); setPlayListInfo(showDetailInfo);
// VOD는 단일 비디오이므로 selectedIndex를 0으로 고정
setSelectedIndex(0);
} }
setShopNowInfo(showDetailInfo[0].productInfos); setShopNowInfo(showDetailInfo[0].productInfos);
saveToLocalSettings(showDetailInfo[0].showId, showDetailInfo[0].patnrId); saveToLocalSettings(showDetailInfo[0].showId, showDetailInfo[0].patnrId);
} }
}, [showDetailInfo]); } else {
// showId가 일치하지 않으면 이전 상태를 재활용하지 않고 초기화
console.log('[PlayerPanel] VOD showDetailInfo mismatch. Clearing playListInfo.', {
panelInfoShowId: panelInfo.showId,
showDetailInfoId: showDetailInfo[0]?.showId,
});
setPlayListInfo(null);
setSelectedIndex(null);
setShopNowInfo(null);
}
}
}, [showDetailInfo, panelInfo.showId, panelInfo.shptmBanrTpNm, fullVideolgCatCd, featuredShowsInfos]);
//LIVE //LIVE
useEffect(() => { useEffect(() => {
@@ -2402,6 +2406,7 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props
> >
{isReadyToPlay && ( {isReadyToPlay && (
<VideoPlayer <VideoPlayer
key={currentPlayingUrl}
setApiProvider={getPlayer} setApiProvider={getPlayer}
disabled={panelInfo.modal} disabled={panelInfo.modal}
onEnded={onEnded} onEnded={onEnded}