[SHOPTIME-3109] Hot Picks / 인디게이터 클릭시 혹은 빈 영역 클릭시할때마다 gtfsDownload.lge 경로 호출

원인 : image view 에 배열형태의 src가 입력되어 리소스 중복호출발생
대책 : src가 배열인 경우, 0번째 src만 사용하도록 수정
This commit is contained in:
yonghyon
2024-10-04 12:37:51 +09:00
parent 29e8e2860f
commit d3b942f710
2 changed files with 6 additions and 5 deletions

View File

@@ -30,16 +30,17 @@ export default memo(function CustomImage({
const showImageJob = useRef(null);
useEffect(() => {
if (src && src !== imgSrc) {
const _src = Array.isArray(src) ? src[0] : src;
if (_src && _src !== imgSrc) {
if (showImageJob.current) {
clearTimeout(showImageJob.current);
showImageJob.current = null;
}
setImgSrc(src);
setImgSrc(_src);
setError(false);
setImageLoaded(false);
}
if (!src) {
if (!_src) {
setError(true);
}
}, [src]);

View File

@@ -85,7 +85,7 @@ export default function TCHH({
>
<Container>
{bgImgPath &&
bgImgPath.slice(0, 2).map((bgImgPath, idx) => {
bgImgPath.slice(0, 2).map((imgpath, idx) => {
return (
<SpottableComponent
key={idx}
@@ -106,7 +106,7 @@ export default function TCHH({
<CustomImage
delay={0}
animationSpeed="fast"
src={bgImgPath}
src={imgpath}
fallbackSrc={defaultImageItem}
alt={curationNm}
ariaLabel={