[251104] fix: UserReviewList TurnBack 중복초기화 제거
🕐 커밋 시간: 2025. 11. 04. 16:43:02 📊 변경 통계: • 총 파일: 1개 • 추가: +5줄 • 삭제: -15줄 📝 수정된 파일: ~ com.twin.app.shoptime/src/views/DetailPanel/ProductAllSection/ProductAllSection.jsx 🔧 주요 변경 내용: • 코드 정리 및 최적화 Performance: 코드 최적화로 성능 개선 기대
This commit is contained in:
@@ -29,7 +29,7 @@ import indicatorDefaultImage
|
||||
// import { pushPanel } from '../../../actions/panelActions';
|
||||
import { minimizeModalMedia } from '../../../actions/mediaActions';
|
||||
import { pauseFullscreenVideo } from '../../../actions/playActions';
|
||||
import { resetShowAllReviews, clearReviewFilter } from '../../../actions/productActions';
|
||||
import { resetShowAllReviews } from '../../../actions/productActions';
|
||||
import {
|
||||
clearAllToasts,
|
||||
removeToast,
|
||||
@@ -362,20 +362,10 @@ export default function ProductAllSection({
|
||||
dispatch(resetShowAllReviews());
|
||||
}, []); // 빈 dependency array = 마운트 시에만 실행
|
||||
|
||||
// ✅ CRITICAL FIX: 상품이 변경되면 리뷰 필터를 초기화
|
||||
// 이전 상품의 필터가 새로운 상품에 적용되는 버그 방지
|
||||
useEffect(() => {
|
||||
if (productData && productData.prdtId) {
|
||||
console.log('[ProductAllSection] 🔄 상품 변경 감지 - 리뷰 필터 초기화:', {
|
||||
prdtId: productData.prdtId,
|
||||
productName: productData.productNm || productData.prdtNm,
|
||||
reason: '새로운 상품으로 전환되었으므로 이전 필터 제거'
|
||||
});
|
||||
|
||||
// Redux의 필터 상태 초기화
|
||||
dispatch(clearReviewFilter());
|
||||
}
|
||||
}, [productData?.prdtId, dispatch]); // prdtId가 변경될 때마다 실행
|
||||
// ⚠️ REMOVED: 상품 변경 시 필터 초기화 로직 제거
|
||||
// 이미 useReviews 훅에서 동일한 기능을 수행하고 있음
|
||||
// ProductAllSection에서 중복으로 호출하면 UserReviewPanel 진입 시
|
||||
// reviewListData가 반복적으로 초기화되어 Chrome에서 진입 불가 발생
|
||||
|
||||
// BUY NOW 버튼 클릭 핸들러 - Toast로 BuyOption 표시
|
||||
const handleBuyNowClick = useCallback((e) => {
|
||||
|
||||
Reference in New Issue
Block a user