Fix username display

This commit is contained in:
Cédric FAMIBELLE-PRONZOLA
2022-05-22 14:18:30 +04:00
parent 57f7b1c606
commit cf8fb41717
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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)
+2 -2
View File
@@ -161,9 +161,9 @@ export default function Teks({parole, paroleId, commentaires, open, success, err
<i>texte soumis par {parole.user.data.attributes.username}</i>
</Typography>
)}
{parole.userAdmin && !parole.user && (
{parole?.userAdmin?.data && !parole.user.data && (
<Typography style={{marginBottom: '1.5em'}} display='block' variant='caption'>
<i>texte soumis par {parole.userAdmin}</i>
<i>texte soumis par {parole.userAdmin.data.attributes.username || parole.userAdmin.data.attributes.firstname}</i>
</Typography>
)}
</Box>