diff --git a/components/shared/nav-bar.tsx b/components/shared/nav-bar.tsx index 7b272c1..88e5064 100644 --- a/components/shared/nav-bar.tsx +++ b/components/shared/nav-bar.tsx @@ -20,6 +20,7 @@ import { NotificationsBell } from '@/components/shared/notifications-bell' import { SoloNavStatusIndicators } from '@/components/solo/nav-status-indicators' import { cn } from '@/lib/utils' import { setActiveProductAction } from '@/actions/active-product' +import { resolveProductSwitchTarget } from '@/lib/product-switch-path' import { debugProps } from '@/lib/debug' interface NavBarProps { @@ -70,7 +71,8 @@ export function NavBar({ } const next = products.find(p => p.id === productId) toast.success(`Actief product: ${next?.name ?? 'gewijzigd'}`) - router.refresh() + const target = resolveProductSwitchTarget(pathname, productId) + if (target) router.push(target); else router.refresh() }) }