fix: add parens around nullish coalescing mixed with logical OR
This commit is contained in:
@@ -25,7 +25,7 @@ function usePageTitle() {
|
|||||||
const pathname = usePathname()
|
const pathname = usePathname()
|
||||||
// pathname is /sites/:id or /sites/:id/section/...
|
// pathname is /sites/:id or /sites/:id/section/...
|
||||||
const segment = pathname.replace(/^\/sites\/[^/]+\/?/, '').split('/')[0]
|
const segment = pathname.replace(/^\/sites\/[^/]+\/?/, '').split('/')[0]
|
||||||
return PAGE_TITLES[segment] ?? segment.charAt(0).toUpperCase() + segment.slice(1) || 'Dashboard'
|
return PAGE_TITLES[segment] ?? (segment ? segment.charAt(0).toUpperCase() + segment.slice(1) : 'Dashboard')
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load sidebar only on the client — prevents SSR flash
|
// Load sidebar only on the client — prevents SSR flash
|
||||||
|
|||||||
Reference in New Issue
Block a user