[251216] fix: DeepLink 처리 isDeepLinkEntry

🕐 커밋 시간: 2025. 12. 16. 17:00:52

📊 변경 통계:
  • 총 파일: 4개
  • 추가: +46줄
  • 삭제: -5줄

📝 수정된 파일:
  ~ com.twin.app.shoptime/src/App/deepLinkHandler.js
  ~ com.twin.app.shoptime/src/views/HomePanel/HomeBanner/HomeBanner.jsx
  ~ com.twin.app.shoptime/src/views/HomePanel/HomePanel.jsx
  ~ com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx

🔧 주요 변경 내용:
  • 핵심 비즈니스 로직 개선
  • 소규모 기능 개선
This commit is contained in:
2025-12-16 17:00:52 +09:00
parent 8a882c28ca
commit dba79789a8
4 changed files with 46 additions and 5 deletions

View File

@@ -85,6 +85,7 @@ export const handleDeepLink = (contentTarget) => (dispatch, _getState) => {
patnrId: patnrId,
chanId: chanId,
shptmBanrTpNm: "LIVE",
modal: false, // DeepLink 진입 시 fullscreen으로 재생
// expsOrd: expsOrd,
};
break;
@@ -101,6 +102,7 @@ export const handleDeepLink = (contentTarget) => (dispatch, _getState) => {
patnrId: patnrId,
showId: showId,
shptmBanrTpNm: "VOD",
modal: false, // DeepLink 진입 시 fullscreen으로 재생
// expsOrd: expsOrd,
};
break;
@@ -274,6 +276,18 @@ export const handleDeepLink = (contentTarget) => (dispatch, _getState) => {
const action =
panelName === panel_names.HOME_PANEL ? updateHomeInfo : pushPanel;
// 🔽 LS(Live Show) 또는 VS(VOD Show)인 경우 DeepLink 진입 플래그 설정
if ((type === 'LS' || type === 'VS') && action === pushPanel) {
dispatch(
updateHomeInfo({
name: panel_names.HOME_PANEL,
panelInfo: {
isDeepLinkEntry: true, // DeepLink PlayerPanel 진입 플래그
},
})
);
}
dispatch(
action({
name: panelName,

View File

@@ -54,6 +54,9 @@ export default function HomeBanner({
const popupVisible = useSelector((state) => state.common.popup.popupVisible);
const panels = useSelector((state) => state.panels.panels);
const isDeepLinkEntry = useSelector(
(state) => state.home.homeInfo?.panelInfo?.isDeepLinkEntry
);
// 🔽 useFocusHistory - 경량화된 범용 포커스 히스토리
const focusHistory = useFocusHistory({
enableLogging: true,
@@ -164,10 +167,11 @@ export default function HomeBanner({
videoData = targetBannerData.bannerDetailInfos?.[0];
}
// DetailPanel이 떠 있는 동안에는 배너 자동 재생을 스킵 (PlayerPanel 모달 재설정 방지)
// 🔽 [251221] DetailPanel이나 DeepLink PlayerPanel이 떠 있으면 배너 자동 재생 스킵
const hasDetailPanel = panels.some((p) => p.name === panel_names.DETAIL_PANEL);
const hasPlayerPanel = panels.some((p) => p.name === panel_names.PLAYER_PANEL);
if (!hasDetailPanel && videoData && (videoData.shptmBanrTpNm === 'LIVE' || videoData.shptmBanrTpNm === 'VOD')) {
if (!hasDetailPanel && !hasPlayerPanel && !isDeepLinkEntry && videoData && (videoData.shptmBanrTpNm === 'LIVE' || videoData.shptmBanrTpNm === 'VOD')) {
console.log('[HomeBanner] 초기 비디오 자동 재생:', defaultFocus);
dispatch(
@@ -185,7 +189,7 @@ export default function HomeBanner({
})
);
}
}, [bannerDataList, defaultFocus, dispatch, panels]);
}, [bannerDataList, defaultFocus, dispatch, panels, isDeepLinkEntry]);
const renderItem = useCallback(
(index, isHorizontal) => {

View File

@@ -1126,6 +1126,9 @@ const HomePanel = ({ isOnTop, showGradientBackground = false }) => {
const detailPanelClosedTime = useSelector(
(state) => state.home.homeInfo?.panelInfo?.detailPanelClosedAt
);
const isDeepLinkEntry = useSelector(
(state) => state.home.homeInfo?.panelInfo?.isDeepLinkEntry
);
useEffect(() => {
if (detailPanelClosed && isOnTop) {
@@ -1137,6 +1140,13 @@ const HomePanel = ({ isOnTop, showGradientBackground = false }) => {
// console.log('[HomePanel] *** videoPlayIntentRef.current:', videoPlayIntentRef.current);
// console.log('[HomePanel] *** lastPlayedBannerIdRef.current:', lastPlayedBannerIdRef.current);
// 🔽 [251221] DeepLink로 PlayerPanel이 진입한 경우 자동 재생 스킵
// (플래그 리셋은 PlayerPanel cleanup에서 처리하므로 여기서는 스킵만)
if (isDeepLinkEntry) {
dlog('[HomePanel] *** [DeepLink] isDeepLinkEntry=true 감지 - 자동 재생 스킵');
return;
}
// 🔽 videoPlayIntentRef가 null인 경우: 비디오 재생 가능한 첫 번째 배너 찾기
if (!videoPlayIntentRef.current && bannerDataList) {
dlog(
@@ -1280,7 +1290,7 @@ const HomePanel = ({ isOnTop, showGradientBackground = false }) => {
);
}
}
}, [detailPanelClosed, isOnTop, bannerDataList, dispatch]);
}, [detailPanelClosed, isOnTop, bannerDataList, isDeepLinkEntry, dispatch]);
// =======
// const justCameBack = !prevIsOnTopRef.current && isOnTop;

View File

@@ -30,6 +30,7 @@ import {
getMainLiveShow,
getMainLiveShowNowProduct,
} from '../../actions/mainActions';
import { updateHomeInfo } from '../../actions/homeActions';
import * as PanelActions from '../../actions/panelActions';
import { updatePanel } from '../../actions/panelActions';
import {
@@ -1170,6 +1171,7 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props
if (!panelInfo.modal) {
console.log('[PlayerPanel] popPanel - closeButtonHandler');
dispatch(PanelActions.popPanel());
// 🔽 [251221] cleanup useEffect에서 isDeepLinkEntry 리셋 처리
dispatch(changeAppStatus({ cursorVisible: false }));
//딮링크로 플레이어 진입 후 이전버튼 클릭시
@@ -1206,6 +1208,17 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props
topPanel: panels[panels.length - 1]?.name,
stack: panels.map((p) => p.name),
});
// 🔽 [251221] PlayerPanel unmount 시 DeepLink 플래그 리셋
dispatch(
updateHomeInfo({
name: panel_names.HOME_PANEL,
panelInfo: {
isDeepLinkEntry: false,
},
})
);
const topPanelName = panels[panels.length - 1]?.name;
if (
panelInfo.modal &&
@@ -1219,7 +1232,7 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props
Spotlight.focus('tbody');
}
};
}, [panelInfo?.modal, isOnTop, panels]);
}, [panelInfo?.modal, isOnTop, panels, dispatch]);
useEffect(() => {
if (showNowInfos && panelInfo.shptmBanrTpNm === 'LIVE') {