mirror of
https://github.com/strapi/strapi.git
synced 2025-09-26 00:39:49 +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 toggle = () => setIsOpen(prev => !prev);
|
||||||
|
|
||||||
const userInfo = auth.getUserInfo();
|
const userInfo = auth.getUserInfo();
|
||||||
const displayName = userInfo
|
const displayName =
|
||||||
|
userInfo.firstname && userInfo.lastname
|
||||||
? `${userInfo.firstname} ${userInfo.lastname}`
|
? `${userInfo.firstname} ${userInfo.lastname}`
|
||||||
: get(userInfo, ['username'], '');
|
: get(userInfo, 'username', '');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Wrapper>
|
<Wrapper>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user