[251026] feat: HomeBanner Video FullScreen Transition Success
🕐 커밋 시간: 2025. 10. 26. 23:21:15 📊 변경 통계: • 총 파일: 2개 • 추가: +35줄 • 삭제: -3줄 📝 수정된 파일: ~ com.twin.app.shoptime/src/actions/playActions.js ~ com.twin.app.shoptime/src/views/HomePanel/HomeBanner/RandomUnit.jsx 🔧 주요 변경 내용: • 핵심 비즈니스 로직 개선 • 소규모 기능 개선
This commit is contained in:
@@ -59,6 +59,27 @@ export const startVideoPlayer =
|
||||
}
|
||||
};
|
||||
|
||||
// 중복 재생 방지: 정말 동일한 요청인지 확인
|
||||
// 같은 배너 + 같은 modal 상태 + 같은 위치 = 정말 동일한 요청이므로 skip
|
||||
const shouldSkipVideoPlayback = (
|
||||
currentPanelInfo,
|
||||
newModalState,
|
||||
newModalContainerId,
|
||||
newBannerId
|
||||
) => {
|
||||
if (!currentPanelInfo) return false;
|
||||
|
||||
const currentBannerId = currentPanelInfo.playerState?.currentBannerId;
|
||||
const currentModal = currentPanelInfo.modal;
|
||||
const currentModalContainerId = currentPanelInfo.modalContainerId;
|
||||
|
||||
return (
|
||||
currentBannerId === newBannerId &&
|
||||
currentModal === newModalState &&
|
||||
currentModalContainerId === newModalContainerId
|
||||
);
|
||||
};
|
||||
|
||||
export const startVideoPlayerNew =
|
||||
({ modal, modalContainerId, modalClassName, spotlightDisable, useNewPlayer, bannerId, ...rest }) =>
|
||||
(dispatch, getState) => {
|
||||
@@ -76,8 +97,8 @@ export const startVideoPlayerNew =
|
||||
// playerState 업데이트: 기존 playerState와 새 데이터 병합
|
||||
const currentPlayerState = topPanel?.panelInfo?.playerState || {};
|
||||
|
||||
// 같은 배너에서 이미 비디오가 재생 중이면 return (중복 재생 방지)
|
||||
if (currentPlayerState.currentBannerId === bannerId) {
|
||||
// ✅ 정확한 비교: 같은 배너 + 같은 modal 상태 + 같은 위치일 때만 skip
|
||||
if (shouldSkipVideoPlayback(topPanel?.panelInfo, modal, modalContainerId, bannerId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user