[251118] feat: HomePanel Detailpanel에서 복귀 감지
🕐 커밋 시간: 2025. 11. 18. 04:17:51 📊 변경 통계: • 총 파일: 2개 • 추가: +33줄 • 삭제: -1줄 📝 수정된 파일: ~ com.twin.app.shoptime/src/views/DetailPanel/DetailPanel.jsx ~ com.twin.app.shoptime/src/views/HomePanel/HomePanel.jsx 🔧 주요 변경 내용: • 소규모 기능 개선
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user