Use firstname + lastname combination only if both are defined, use username otherwise

This commit is contained in:
Convly 2020-12-28 11:45:19 +01:00
parent fec4ac3f04
commit ad3006ba26

View File

@ -31,9 +31,10 @@ const Logout = ({ history: { push } }) => {
const toggle = () => setIsOpen(prev => !prev);
const userInfo = auth.getUserInfo();
const displayName = userInfo
const displayName =
userInfo.firstname && userInfo.lastname
? `${userInfo.firstname} ${userInfo.lastname}`
: get(userInfo, ['username'], '');
: get(userInfo, 'username', '');
return (
<Wrapper>