feat(nav-bar): gebruik resolveProductSwitchTarget bij product-wissel

Vervang router.refresh() door gerichte navigatie via resolveProductSwitchTarget,
zodat product/sprint/solo-pagina's direct naar het nieuwe product navigeren.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Scrum4Me Agent 2026-05-14 21:41:32 +02:00
parent 34c26ee410
commit e471fb3e85

View file

@ -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()
})
}