INNER CODE UNIT · TypeScript
routeTitle
opensquilla/opensquilla · opensquilla-webui/src/router/index.ts:66
export function routeTitle(route: RouteLocationNormalized): string {
const explicitKey = route.meta?.titleKey
if (explicitKey) {
const translated = i18n.global.t(explicitKey)
if (translated !== explicitKey) return translated
}
const name = typeof route.name === 'string' ? route.name : ''
if (name) {
const key = `nav.${name}`
const translated = i18n.global.t(key)
if (translated !== key) return translated
}
return (route.meta?.title as string) || 'OpenSquilla'
}
router.afterEach((to, _from, failure) => {
if (failure || !isChatRoutePath(to.path)) {
clearPrimedSessionBootstrapAdmission()