[DetailPanel] SHOPTIME-2987
- My Page / Recentrly Viewed / Theme Detail 에서 본 Product 가 Recently에 표시되지 않음
This commit is contained in:
@@ -4,45 +4,48 @@ import React, {
|
||||
useMemo,
|
||||
useRef,
|
||||
useState,
|
||||
} from "react";
|
||||
} from 'react';
|
||||
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import {
|
||||
useDispatch,
|
||||
useSelector,
|
||||
} from 'react-redux';
|
||||
|
||||
import Spotlight from "@enact/spotlight";
|
||||
import Spotlight from '@enact/spotlight';
|
||||
|
||||
import {
|
||||
changeAppStatus,
|
||||
changeLocalSettings,
|
||||
setHidePopup,
|
||||
} from "../../actions/commonActions";
|
||||
import { clearCouponInfo } from "../../actions/couponActions";
|
||||
import { getDeviceAdditionInfo } from "../../actions/deviceActions";
|
||||
} from '../../actions/commonActions';
|
||||
import { clearCouponInfo } from '../../actions/couponActions';
|
||||
import { getDeviceAdditionInfo } from '../../actions/deviceActions';
|
||||
import {
|
||||
clearThemeDetail,
|
||||
getThemeCurationDetailInfo,
|
||||
getThemeHotelDetailInfo,
|
||||
} from "../../actions/homeActions";
|
||||
import { getMainCategoryDetail } from "../../actions/mainActions";
|
||||
import { popPanel } from "../../actions/panelActions";
|
||||
import { finishVideoPreview } from "../../actions/playActions";
|
||||
} from '../../actions/homeActions';
|
||||
import { getMainCategoryDetail } from '../../actions/mainActions';
|
||||
import { popPanel } from '../../actions/panelActions';
|
||||
import { finishVideoPreview } from '../../actions/playActions';
|
||||
import {
|
||||
clearProductDetail,
|
||||
getProductGroup,
|
||||
getProductImageLength,
|
||||
} from "../../actions/productActions";
|
||||
import MobileSendPopUp from "../../components/MobileSend/MobileSendPopUp";
|
||||
import TBody from "../../components/TBody/TBody";
|
||||
import THeader from "../../components/THeader/THeader";
|
||||
import TPanel from "../../components/TPanel/TPanel";
|
||||
import * as Config from "../../utils/Config";
|
||||
import { panel_names } from "../../utils/Config";
|
||||
import { $L } from "../../utils/helperMethods";
|
||||
import css from "./DetailPanel.module.less";
|
||||
import GroupProduct from "./GroupProduct/GroupProduct";
|
||||
import SingleProduct from "./SingleProduct/SingleProduct";
|
||||
import ThemeProduct from "./ThemeProduct/ThemeProduct";
|
||||
import UnableProduct from "./UnableProduct/UnableProduct";
|
||||
import YouMayLike from "./YouMayLike/YouMayLike";
|
||||
} from '../../actions/productActions';
|
||||
import MobileSendPopUp from '../../components/MobileSend/MobileSendPopUp';
|
||||
import TBody from '../../components/TBody/TBody';
|
||||
import THeader from '../../components/THeader/THeader';
|
||||
import TPanel from '../../components/TPanel/TPanel';
|
||||
import * as Config from '../../utils/Config';
|
||||
import { panel_names } from '../../utils/Config';
|
||||
import { $L } from '../../utils/helperMethods';
|
||||
import css from './DetailPanel.module.less';
|
||||
import GroupProduct from './GroupProduct/GroupProduct';
|
||||
import SingleProduct from './SingleProduct/SingleProduct';
|
||||
import ThemeProduct from './ThemeProduct/ThemeProduct';
|
||||
import UnableProduct from './UnableProduct/UnableProduct';
|
||||
import YouMayLike from './YouMayLike/YouMayLike';
|
||||
|
||||
export default function DetailPanel({ panelInfo, isOnTop, spotlightId }) {
|
||||
const [lgCatCd, setLgCatCd] = useState("");
|
||||
@@ -161,6 +164,11 @@ export default function DetailPanel({ panelInfo, isOnTop, spotlightId }) {
|
||||
|
||||
const saveToLocalSettings = useCallback(() => {
|
||||
let recentItems = [];
|
||||
const prdtId =
|
||||
themeProductInfos && themeProductInfos.length > 0 && type === "theme"
|
||||
? themeProductInfos[selectedIndex].prdtId
|
||||
: panelInfo?.prdtId;
|
||||
|
||||
if (localRecentItems) {
|
||||
recentItems = [...localRecentItems];
|
||||
}
|
||||
@@ -193,7 +201,14 @@ export default function DetailPanel({ panelInfo, isOnTop, spotlightId }) {
|
||||
} else {
|
||||
dispatch(changeLocalSettings({ recentItems }));
|
||||
}
|
||||
}, [panelInfo, httpHeader, localRecentItems, dispatch]);
|
||||
}, [
|
||||
panelInfo?.prdtId,
|
||||
httpHeader,
|
||||
localRecentItems,
|
||||
dispatch,
|
||||
selectedIndex,
|
||||
themeProductInfos,
|
||||
]);
|
||||
|
||||
const getlgCatCd = useCallback(() => {
|
||||
if (productData && !curationId) {
|
||||
@@ -277,7 +292,7 @@ export default function DetailPanel({ panelInfo, isOnTop, spotlightId }) {
|
||||
if (panelInfo && patnrId && prdtId) {
|
||||
saveToLocalSettings();
|
||||
}
|
||||
}, [panelInfo]);
|
||||
}, [panelInfo, selectedIndex]);
|
||||
|
||||
useEffect(() => {
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user