TItemCard 통합로그 호출 시 로그시나리오에 속하는 클릭에서만 호출되도록 방어로직 추가

This commit is contained in:
dongyoungKo
2025-05-16 16:30:31 +09:00
parent d291f78e7b
commit e5739f3ab2

View File

@@ -112,25 +112,27 @@ export default memo(function TItemCard({
if (onClick) {
onClick(e);
const params = {
contextName: contextName,
messageId: messageId,
shelfLocation: shelfLocation,
shelfId: shelfId,
shelfTitle: shelfTitle,
productId: productId,
productTitle: productName,
partner: patnerName,
brand: brandName,
price: originalPrice,
discount: discountRate,
locaiton: location,
category: catNm,
};
dispatch(sendLogTotalRecommend(params));
if (contextName && messageId) {
const params = {
contextName: contextName,
messageId: messageId,
shelfLocation: shelfLocation,
shelfId: shelfId,
shelfTitle: shelfTitle,
productId: productId,
productTitle: productName,
partner: patnerName,
brand: brandName,
price: originalPrice,
discount: discountRate,
locaiton: location,
category: catNm,
};
dispatch(sendLogTotalRecommend(params));
}
}
},
[onClick, disabled]
[onClick, disabled, contextName, messageId]
);
const _onFocus = useCallback(() => {
if (onFocus) {