[SHOPTIME-3954] 미국 / Home / Popular show / 영상 진입 후 이전 버튼 클릭시 포커싱 사라짐

수정 내용: popularShow에서 updateHomeInfo -> lastFocusedTargetrId 추가
This commit is contained in:
hyunwoo93.cha
2025-01-21 20:05:52 +09:00
parent 47ff8df067
commit 54e7cdcc65
2 changed files with 14 additions and 5 deletions

View File

@@ -492,11 +492,7 @@ const HomePanel = ({ isOnTop }) => {
}, [dispatch]);
useEffect(() => {
if (
isOnTop &&
panelInfo?.focusedContainerId === TEMPLATE_CODE_CONF.TOP &&
panelInfo?.lastFocusedTargetId
) {
if (isOnTop && panelInfo?.lastFocusedTargetId) {
Spotlight.focus(panelInfo.lastFocusedTargetId);
}
}, [isOnTop]);

View File

@@ -5,7 +5,9 @@ import { useDispatch, useSelector } from "react-redux";
import Spotlight from "@enact/spotlight";
import { SpotlightContainerDecorator } from "@enact/spotlight/SpotlightContainerDecorator";
import Spottable from "@enact/spotlight/Spottable";
import { getContainerId } from "@enact/spotlight/src/container";
import { updateHomeInfo } from "../../../actions/homeActions";
import { pushPanel } from "../../../actions/panelActions";
import { startVideoPlayer } from "../../../actions/playActions";
import SectionTitle from "../../../components/SectionTitle/SectionTitle";
@@ -59,6 +61,17 @@ const PopularShow = ({
const handleCardClick = useCallback(
(patnrId, showId, catCd, showUrl) => () => {
const lastFocusedTargetId = getContainerId(Spotlight.getCurrent());
if (lastFocusedTargetId) {
dispatch(
updateHomeInfo({
name: panel_names.HOME_PANEL,
panelInfo: { lastFocusedTargetId },
})
);
}
dispatch(
startVideoPlayer({
showId,