diff --git a/com.twin.app.shoptime/src/views/DetailPanel/DetailPanel.jsx b/com.twin.app.shoptime/src/views/DetailPanel/DetailPanel.jsx index f78501fb..bea6cd05 100644 --- a/com.twin.app.shoptime/src/views/DetailPanel/DetailPanel.jsx +++ b/com.twin.app.shoptime/src/views/DetailPanel/DetailPanel.jsx @@ -17,7 +17,7 @@ import Spotlight from '@enact/spotlight'; import { setContainerLastFocusedElement } from '@enact/spotlight/src/container'; import { getDeviceAdditionInfo } from '../../actions/deviceActions'; -import { getThemeCurationDetailInfo } from '../../actions/homeActions'; +import { getThemeCurationDetailInfo, updateHomeInfo } from '../../actions/homeActions'; import { getMainCategoryDetail, getMainYouMayLike, @@ -148,6 +148,23 @@ export default function DetailPanel({ panelInfo, isOnTop, spotlightId }) { }; }, [dispatch]); + // ✅ [251118] DetailPanel이 사라질 때 HomePanel의 비디오 재생 활성화 + useEffect(() => { + return () => { + // DetailPanel이 unmount되는 시점 + console.log('[DetailPanel] unmount - HomePanel 활성화 신호 전송'); + + // HomePanel에서 비디오 재생을 다시 시작하도록 신호 보내기 + dispatch(updateHomeInfo({ + name: panel_names.HOME_PANEL, + panelInfo: { + shouldResumeVideo: true, // ✅ 신호 + lastDetailPanelClosed: Date.now(), // ✅ 시점 기록 + } + })); + }; + }, [dispatch]); + const onBackClick = useCallback( (isCancelClick) => (ev) => { fp.pipe( diff --git a/com.twin.app.shoptime/src/views/HomePanel/HomePanel.jsx b/com.twin.app.shoptime/src/views/HomePanel/HomePanel.jsx index f76d2401..be432816 100644 --- a/com.twin.app.shoptime/src/views/HomePanel/HomePanel.jsx +++ b/com.twin.app.shoptime/src/views/HomePanel/HomePanel.jsx @@ -758,6 +758,21 @@ const HomePanel = ({ isOnTop }) => { console.log('[HomeActive] 재생 기록 업데이트:', bannerId); }, [isOnTop, dispatch]); + // ✅ [251118] DetailPanel 닫힘 감지 useEffect + const detailPanelClosedTime = useSelector( + (state) => state.home.homeInfo?.panelInfo?.lastDetailPanelClosed + ); + + 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); + } + }, [detailPanelClosedTime, isOnTop]); + useEffect(() => { return () => { const c = Spotlight.getCurrent();