mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 16:29:34 +00:00
Use firstname + lastname combination only if both are defined, use username otherwise
This commit is contained in:
parent
fec4ac3f04
commit
ad3006ba26
@ -31,9 +31,10 @@ const Logout = ({ history: { push } }) => {
|
||||
const toggle = () => setIsOpen(prev => !prev);
|
||||
|
||||
const userInfo = auth.getUserInfo();
|
||||
const displayName = userInfo
|
||||
? `${userInfo.firstname} ${userInfo.lastname}`
|
||||
: get(userInfo, ['username'], '');
|
||||
const displayName =
|
||||
userInfo.firstname && userInfo.lastname
|
||||
? `${userInfo.firstname} ${userInfo.lastname}`
|
||||
: get(userInfo, 'username', '');
|
||||
|
||||
return (
|
||||
<Wrapper>
|
||||
|
Loading…
x
Reference in New Issue
Block a user