diff --git a/components/teks/pataje.js b/components/teks/pataje.js index 0261197..2c796a8 100644 --- a/components/teks/pataje.js +++ b/components/teks/pataje.js @@ -51,7 +51,7 @@ export default function Pataje({parole, setError, setSuccess}) { const alias = artistes.data.map(({attributes}) => attributes.alias) const renderAwtis = new Intl.ListFormat('fr').format(alias) - const text = parole.user || parole.userAdmin ? `${renderAwtis} - ${titre} (Paroles et Traductions) - (texte soumis par ${parole?.user?.data?.attributes?.username || parole.userAdmin?.data?.attributes?.username})` : `${renderAwtis} - ${parole} (Paroles et Traductions)` + const text = parole.user || parole.userAdmin ? `${renderAwtis} - ${titre} (Paroles et Traductions) - (texte soumis par ${parole?.user?.data?.attributes?.username || parole.userAdmin?.data?.attributes?.username || parole.userAdmin?.data?.attributes?.firstname})` : `${renderAwtis} - ${parole} (Paroles et Traductions)` const handleClose = () => { setOpen(false) diff --git a/components/teks/teks.js b/components/teks/teks.js index 90d4aa4..60af9e1 100644 --- a/components/teks/teks.js +++ b/components/teks/teks.js @@ -161,9 +161,9 @@ export default function Teks({parole, paroleId, commentaires, open, success, err texte soumis par {parole.user.data.attributes.username} )} - {parole.userAdmin && !parole.user && ( + {parole?.userAdmin?.data && !parole.user.data && ( - texte soumis par {parole.userAdmin} + texte soumis par {parole.userAdmin.data.attributes.username || parole.userAdmin.data.attributes.firstname} )}