summaryrefslogtreecommitdiff
path: root/src-migrate/modules/product-detail/components/Breadcrumb.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src-migrate/modules/product-detail/components/Breadcrumb.tsx')
-rw-r--r--src-migrate/modules/product-detail/components/Breadcrumb.tsx3
1 files changed, 2 insertions, 1 deletions
diff --git a/src-migrate/modules/product-detail/components/Breadcrumb.tsx b/src-migrate/modules/product-detail/components/Breadcrumb.tsx
index 0e263fe9..a0f983d0 100644
--- a/src-migrate/modules/product-detail/components/Breadcrumb.tsx
+++ b/src-migrate/modules/product-detail/components/Breadcrumb.tsx
@@ -10,12 +10,13 @@ type Props = { id: number; name: string };
const Breadcrumb = ({ id, name }: Props) => {
const { isDesktop, isMobile } = useDevice();
- const { data: breadcrumbs = [] } = useQuery({
+ const { data } = useQuery({
queryKey: ['product-category-breadcrumb', id],
queryFn: () => getProductCategoryBreadcrumb(id),
refetchOnWindowFocus: false,
});
+ const breadcrumbs = data ?? [];
const total = breadcrumbs.length;
const lastCat = total ? breadcrumbs[total - 1] : null;
const hasHidden = total > 1;