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:
parent
34c26ee410
commit
e471fb3e85
1 changed files with 3 additions and 1 deletions
|
|
@ -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()
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue