From e7d0f56e85428edc5f1d26075d5adf6ff1bddd24 Mon Sep 17 00:00:00 2001 From: Greg Hoskin Date: Wed, 12 May 2021 11:23:04 -0500 Subject: [PATCH] fix checkout url, product w/ no images error --- framework/swell/utils/normalize.ts | 2 +- next.config.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/swell/utils/normalize.ts b/framework/swell/utils/normalize.ts index a7a7be1ce..cc8eafdb7 100644 --- a/framework/swell/utils/normalize.ts +++ b/framework/swell/utils/normalize.ts @@ -60,7 +60,7 @@ const normalizeProductOption = ({ } const normalizeProductImages = (images: SwellImage[]) => { - if (!images) { + if (!images || images.length < 1) { return [{ url: '/' }] } return images?.map(({ file, ...rest }: SwellImage) => ({ diff --git a/next.config.js b/next.config.js index 1e1b1a126..e17d3e5c4 100644 --- a/next.config.js +++ b/next.config.js @@ -7,7 +7,7 @@ const { const provider = commerce.provider || getProviderName() const isBC = provider === 'bigcommerce' const isShopify = provider === 'shopify' -const isSwell = commerce.provider === 'swell' +const isSwell = provider === 'swell' module.exports = withCommerceConfig({ commerce,