Switch to translatable data
This commit is contained in:
@@ -10,6 +10,7 @@ const app = useNuxtApp();
|
||||
const { loggedIn } = useUserSession();
|
||||
const localePath = useLocalePath();
|
||||
const { t } = useI18n();
|
||||
const { tKey, hasKey } = useI18nKey();
|
||||
const router = useRouter();
|
||||
|
||||
const { name, id } = app.$slugData.huntSlug!;
|
||||
@@ -21,7 +22,7 @@ const { data, pending, refresh } = await useFetch(
|
||||
|
||||
useHead({
|
||||
title: t('layouts.title', {
|
||||
title: data.value?.name || name
|
||||
title: hasKey(data.value, 'name') ? tKey(data.value!, 'name').value : name
|
||||
})
|
||||
});
|
||||
|
||||
@@ -31,7 +32,7 @@ watch(loggedIn, (isLoggedIn) => {
|
||||
}
|
||||
});
|
||||
|
||||
titleStore.title = data.value?.name;
|
||||
titleStore.title = data.value ? tKey(data.value, 'name').value : undefined;
|
||||
|
||||
type Data = NonNullable<(typeof data)['value']>;
|
||||
export type Team = Data['teams'][number];
|
||||
|
||||
Reference in New Issue
Block a user