From cc68e36260390c0a6a7862fe7b0bbe3eca0c5dbc Mon Sep 17 00:00:00 2001 From: Konstantin Wohlwend Date: Wed, 17 Jun 2026 11:35:00 -0700 Subject: [PATCH] Make UserButton render a glyph again when user is not signed in --- .../src/components/dashboard-user-button.tsx | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/apps/dashboard/src/components/dashboard-user-button.tsx b/apps/dashboard/src/components/dashboard-user-button.tsx index 3148d6c3a..4cc6382c7 100644 --- a/apps/dashboard/src/components/dashboard-user-button.tsx +++ b/apps/dashboard/src/components/dashboard-user-button.tsx @@ -44,8 +44,7 @@ function DashboardUserAvatar(props: { }) { const size = props.size ?? 34; const user = props.user; - const label = user?.displayName ?? user?.primaryEmail ?? "User"; - const initials = label.slice(0, 2).toUpperCase(); + const initials = user == null ? null : (user.displayName ?? user.primaryEmail)?.slice(0, 2).toUpperCase(); return ( - - - {initials} - + + {initials == null ? ( + + ) : ( + + {initials} + + )} ); @@ -174,7 +177,11 @@ function DashboardUserButtonInner(props: DashboardUserButtonProps) { text="Sign out" variant="destructive" onClick={async () => await user.signOut()} - icon={} + icon={( + + + + )} /> )}