Remove filter to avoid additional computations as per https://github.com/vercel/commerce/pull/80#discussion_r531142893. Placeholder images will display as fallback.

This commit is contained in:
Leah Wagner 2021-01-23 21:48:40 -08:00
parent d23cbdb3c8
commit 719c7e03cc

View File

@ -46,7 +46,6 @@ export async function getStaticProps({
// Create a copy of products that we can mutate
// Filter products that do not have images
const products = [...newestProducts]
.filter((p) => p.node.images.edges!.length > 0)
// If the lists of featured and best selling products don't have enough
// products, then fill them with products from the products list, this
// is useful for new commerce sites that don't have a lot of products