[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:
@@ -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 //기존에 호출했으면 안한다.
|
||||
) {
|
||||
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 (
|
||||
panelInfo.shptmBanrTpNm === 'VOD' &&
|
||||
showDetailInfo &&
|
||||
showDetailInfo[0] &&
|
||||
showDetailInfo[0].showId &&
|
||||
showDetailInfo[0].patnrId
|
||||
) {
|
||||
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);
|
||||
}
|
||||
}, [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
|
||||
useEffect(() => {
|
||||
@@ -2402,6 +2406,7 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props
|
||||
>
|
||||
{isReadyToPlay && (
|
||||
<VideoPlayer
|
||||
key={currentPlayingUrl}
|
||||
setApiProvider={getPlayer}
|
||||
disabled={panelInfo.modal}
|
||||
onEnded={onEnded}
|
||||
|
||||
Reference in New Issue
Block a user