diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2025-09-29 05:20:43 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2025-09-29 05:20:43 +0000 |
| commit | 0c8f06679b1f6ba3f6c8a73fecf461646b842a38 (patch) | |
| tree | 1599a22e609b194e00d2f6eeed72c244e65a6c66 /src-migrate/modules/product-detail/components/Breadcrumb.tsx | |
| parent | 3ccfa710d65ff607f21c8eec5d77e343b6ed800a (diff) | |
| parent | 6174fcca46f50be04a48f02098cb049e94e455d3 (diff) | |
Merged in crawl-fix (pull request #467)
Crawl fix
Diffstat (limited to 'src-migrate/modules/product-detail/components/Breadcrumb.tsx')
| -rw-r--r-- | src-migrate/modules/product-detail/components/Breadcrumb.tsx | 3 |
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; |
