From accfb6c38cb1ecffdd346cb17b57d65b326424ff Mon Sep 17 00:00:00 2001 From: Henrik Larsson Date: Sun, 13 Aug 2023 22:17:44 +0200 Subject: [PATCH] Links and data fetching for dynamic routes --- components/product/product-view.tsx | 2 +- middleware.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/components/product/product-view.tsx b/components/product/product-view.tsx index 310f7e19c..4b9a311a7 100644 --- a/components/product/product-view.tsx +++ b/components/product/product-view.tsx @@ -81,7 +81,7 @@ export default function ProductView({ product, relatedProducts }: ProductViewPro - {relatedProducts.length > 0 && ( + {relatedProducts && relatedProducts.length > 0 && (
diff --git a/middleware.ts b/middleware.ts index 2a111af00..2a1cb0d55 100644 --- a/middleware.ts +++ b/middleware.ts @@ -6,6 +6,7 @@ export default createMiddleware({ // If this locale is matched, pathnames work without a prefix (e.g. `/about`) defaultLocale: 'sv', + // Dismissing this during, review when going to prod. localeDetection: false });