fix: keep vendor sidebar active on account settings page
Vendor sidebar collapsed and tenant sidebar appeared when navigating to /settings/account because onVendorRoute was false for non-/vendor paths. Now vendor users stay on vendor sidebar for all routes except /tenant/*. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -44,9 +44,11 @@ export function Layout() {
|
||||
refetchInterval: 30_000,
|
||||
});
|
||||
const isTenantAdmin = scopes.has('tenant:manage');
|
||||
const onVendorRoute = location.pathname.startsWith('/vendor');
|
||||
// Vendor on vendor routes: show only TENANTS. On tenant routes: show tenant portal too (for debugging).
|
||||
const showTenantPortal = isTenantAdmin && (!isVendor || !onVendorRoute);
|
||||
const onTenantRoute = location.pathname.startsWith('/tenant');
|
||||
const onVendorRoute = location.pathname.startsWith('/vendor') || (isVendor && !onTenantRoute);
|
||||
// Vendor on vendor routes (or neutral pages like account settings): show only vendor sidebar.
|
||||
// On tenant routes: show tenant portal too (for debugging).
|
||||
const showTenantPortal = isTenantAdmin && (!isVendor || onTenantRoute);
|
||||
|
||||
// Build breadcrumbs from path
|
||||
const segments = location.pathname.replace(/^\//, '').split('/').filter(Boolean);
|
||||
|
||||
Reference in New Issue
Block a user