[251118] fix: HomePanel return from DetailPanel video playing-1
🕐 커밋 시간: 2025. 11. 18. 10:53:59 📊 변경 통계: • 총 파일: 3개 • 추가: +66줄 • 삭제: -39줄 📝 수정된 파일: ~ com.twin.app.shoptime/src/actions/panelActions.js ~ com.twin.app.shoptime/src/actions/playActions.js ~ com.twin.app.shoptime/src/views/HomePanel/HomePanel.jsx 🔧 주요 변경 내용: • 핵심 비즈니스 로직 개선 • 소규모 기능 개선 • 코드 정리 및 최적화
This commit is contained in:
@@ -754,27 +754,42 @@ const HomePanel = ({ isOnTop }) => {
|
||||
|
||||
useEffect(() => {
|
||||
if (detailPanelClosedTime && isOnTop) {
|
||||
console.log('[HomePanel] ✅ DetailPanel 닫힘 감지됨!');
|
||||
console.log('[HomePanel] lastDetailPanelClosed:', detailPanelClosedTime);
|
||||
console.log('[HomePanel] isOnTop:', isOnTop);
|
||||
console.log('[HomePanel] videoPlayIntentRef.current:', videoPlayIntentRef.current);
|
||||
console.log('[HomePanel] lastPlayedBannerIdRef.current:', lastPlayedBannerIdRef.current);
|
||||
console.log('[HomePanel] *** ✅ DetailPanel 닫힘 감지됨!');
|
||||
console.log('[HomePanel] *** lastDetailPanelClosed:', detailPanelClosedTime);
|
||||
console.log('[HomePanel] *** isOnTop:', isOnTop);
|
||||
console.log('[HomePanel] *** videoPlayIntentRef.current:', videoPlayIntentRef.current);
|
||||
console.log('[HomePanel] *** lastPlayedBannerIdRef.current:', lastPlayedBannerIdRef.current);
|
||||
|
||||
// [TODO] DetailPanel 닫힘 후 비디오 자동 재생 복구
|
||||
if (videoPlayIntentRef.current && lastPlayedBannerIdRef.current) {
|
||||
dispatch(startVideoPlayerNew({
|
||||
modal: true,
|
||||
modalContainerId: 'home-video-modal',
|
||||
modalClassName: 'home-video-modal',
|
||||
bannerId: lastPlayedBannerIdRef.current,
|
||||
videoId: videoPlayIntentRef.current.videoId,
|
||||
showUrl: videoPlayIntentRef.current.showUrl,
|
||||
patnrId: videoPlayIntentRef.current.patnrId,
|
||||
showId: videoPlayIntentRef.current.showId,
|
||||
shptmBanrTpNm: videoPlayIntentRef.current.shptmBanrTpNm,
|
||||
lgCatCd: videoPlayIntentRef.current.lgCatCd,
|
||||
}));
|
||||
|
||||
// 🔽 videoPlayIntentRef는 videoProps에 비디오 정보를 담고 있으므로 풀어서 전달
|
||||
// 혹시 videoProps에 없는 필드는 상위 레벨을 fallback으로 사용
|
||||
const intent = videoPlayIntentRef.current;
|
||||
const videoProps = intent.videoProps || {};
|
||||
|
||||
// 🔽 [251118] 현재 스크롤 위치 확인하여 비디오 크기 결정
|
||||
const currentScrollTop = prevScrollTopRef.current;
|
||||
const shouldShrink = currentScrollTop > 1;
|
||||
console.log('[HomePanel] *** 비디오 복구 - currentScrollTop:', currentScrollTop, ', shouldShrink:', shouldShrink);
|
||||
|
||||
dispatch(
|
||||
startVideoPlayerNew({
|
||||
...videoProps,
|
||||
modal: true,
|
||||
modalContainerId: videoProps.modalContainerId || 'home-video-modal',
|
||||
modalClassName: videoProps.modalClassName || 'home-video-modal',
|
||||
spotlightDisable: true, // 자동 복구 시 스크롤 이동 막기 위해 포커스 이동 금지
|
||||
bannerId: lastPlayedBannerIdRef.current,
|
||||
videoId: videoProps.videoId || intent.videoId,
|
||||
showUrl: videoProps.showUrl || intent.showUrl,
|
||||
patnrId: videoProps.patnrId || intent.patnrId,
|
||||
showId: videoProps.showId || intent.showId,
|
||||
shptmBanrTpNm: videoProps.shptmBanrTpNm || intent.shptmBanrTpNm,
|
||||
lgCatCd: videoProps.lgCatCd || intent.lgCatCd,
|
||||
shouldShrinkTo1px: shouldShrink, // 스크롤 위치에 따라 설정
|
||||
})
|
||||
);
|
||||
|
||||
// refs 초기화
|
||||
videoPlayIntentRef.current = null;
|
||||
lastPlayedBannerIdRef.current = null;
|
||||
|
||||
Reference in New Issue
Block a user