fix: prefer main image for detail preview cards
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled

This commit is contained in:
Your Name 2026-04-28 18:00:40 +08:00
parent bfb492babd
commit ac58f28612

View File

@ -721,7 +721,9 @@ function getCandidatePreviewUrl(
target === "main"
? candidate.mainImageUrls || []
: target === "detail"
? candidate.detailImageUrls || []
? candidate.mainImageUrls.length > 0
? candidate.mainImageUrls
: candidate.detailImageUrls || []
: candidate.skuImageUrls || [];
const targetUrls = rawTargetUrls;
return (
@ -741,7 +743,9 @@ function getCandidatePreviewUrls(
target === "main"
? candidate.mainImageUrls || []
: target === "detail"
? candidate.detailImageUrls || []
? candidate.mainImageUrls.length > 0
? candidate.mainImageUrls
: candidate.detailImageUrls || []
: candidate.skuImageUrls || [];
const targetUrls = rawTargetUrls;
const fallbackUrls = [