Azene
Azene
NNuxt
Created by Azene on 6/24/2024 in #❓・help
Async Data and useSeoMeta
It doesn't display the name or the description of the user
17 replies
NNuxt
Created by Azene on 6/24/2024 in #❓・help
Async Data and useSeoMeta
THe thing is that I do get infos from my server, but when I send a link like this: https://www.neeft.fr/joueurs/C0unt
17 replies
NNuxt
Created by Azene on 6/24/2024 in #❓・help
Async Data and useSeoMeta
Even with that change it doesn't work, this thing is driving me crazy
17 replies
NNuxt
Created by Azene on 6/24/2024 in #❓・help
Async Data and useSeoMeta
I changed it earlier but it doesn't work, except if it wasn't what you meant:
<script lang="ts" setup>
import { httpsCallable } from 'firebase/functions'
const { $fireFunctions } = useNuxtApp()
const { normalizedUser } = useNormalizer()
const route = useRoute()
const slug = ref(route.params.id)

const { data: player, pending: pendingPlayer } = await useAsyncData('player', async () => {
const getFirePlayer = httpsCallable($fireFunctions as any, 'getUser')
const res: any = await getFirePlayer({ username: slug.value })
return normalizedUser(res.data.data)
}, {
server: false,
watch: [slug]
})

useSeoMeta({
title: () => `${player.value?.userData?.username ? 'NEEFT - Profil de ' + player.value?.userData?.username : 'NEEFT - Profil de joueur'}`,
description: () => player.value?.userData?.ambition?.substring(0, 160) || '',
ogTitle: () => `${player.value?.userData?.username ? 'NEEFT - Profil de ' + player.value?.userData?.username : 'NEEFT - Profil de joueur'}`,
ogImage: () => player.value?.userData?.customization?.avatarUrl,
ogDescription: () => player.value?.userData?.ambition?.substring(0, 160) || '',
ogUrl: () => `https://www.neeft.fr${route.path}`,
twitterTitle: () => `${player.value?.userData?.username ? 'NEEFT - Profil de ' + player.value?.userData?.username : 'NEEFT - Profil de joueur'}`,
twitterDescription: () => player.value?.userData?.ambition?.substring(0, 160) || '',
twitterImage: () => player.value?.userData?.customization?.avatarUrl,
twitterCard: () => 'summary'
})

</script>
<script lang="ts" setup>
import { httpsCallable } from 'firebase/functions'
const { $fireFunctions } = useNuxtApp()
const { normalizedUser } = useNormalizer()
const route = useRoute()
const slug = ref(route.params.id)

const { data: player, pending: pendingPlayer } = await useAsyncData('player', async () => {
const getFirePlayer = httpsCallable($fireFunctions as any, 'getUser')
const res: any = await getFirePlayer({ username: slug.value })
return normalizedUser(res.data.data)
}, {
server: false,
watch: [slug]
})

useSeoMeta({
title: () => `${player.value?.userData?.username ? 'NEEFT - Profil de ' + player.value?.userData?.username : 'NEEFT - Profil de joueur'}`,
description: () => player.value?.userData?.ambition?.substring(0, 160) || '',
ogTitle: () => `${player.value?.userData?.username ? 'NEEFT - Profil de ' + player.value?.userData?.username : 'NEEFT - Profil de joueur'}`,
ogImage: () => player.value?.userData?.customization?.avatarUrl,
ogDescription: () => player.value?.userData?.ambition?.substring(0, 160) || '',
ogUrl: () => `https://www.neeft.fr${route.path}`,
twitterTitle: () => `${player.value?.userData?.username ? 'NEEFT - Profil de ' + player.value?.userData?.username : 'NEEFT - Profil de joueur'}`,
twitterDescription: () => player.value?.userData?.ambition?.substring(0, 160) || '',
twitterImage: () => player.value?.userData?.customization?.avatarUrl,
twitterCard: () => 'summary'
})

</script>
17 replies
NNuxt
Created by Azene on 6/24/2024 in #❓・help
Async Data and useSeoMeta
Nope doesn't change a thing either
17 replies
NNuxt
Created by Azene on 6/24/2024 in #❓・help
Async Data and useSeoMeta
Well if I'm not wrong I am using composition api, maybe it's because your using a local store
17 replies
NNuxt
Created by Azene on 6/24/2024 in #❓・help
Async Data and useSeoMeta
Just tried it but it didn't change a thing :/
17 replies