From 0cdd9830162f3918d21bf9b6dd874f3484ba88e8 Mon Sep 17 00:00:00 2001 From: Haytham Abuelfutuh Date: Tue, 23 Feb 2021 17:16:05 -0800 Subject: [PATCH] fix: Use name if preferredUsername is empty (#148) * Use name if preferredUsername is empty https://github.com/flyteorg/flyte/issues/657 * check for empty string --- src/components/Navigation/UserInformation.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/Navigation/UserInformation.tsx b/src/components/Navigation/UserInformation.tsx index 6a353291e..ab2a9fb00 100644 --- a/src/components/Navigation/UserInformation.tsx +++ b/src/components/Navigation/UserInformation.tsx @@ -26,8 +26,12 @@ export const UserInformation: React.FC<{}> = () => { {profile.value == null ? ( ) : ( - profile.value.preferredUsername - )} + profile.value.preferredUsername == null || profile.value.preferredUsername == "" ? ( + profile.value.name + ) : ( + profile.value.preferredUsername + ) + )} );