fix(dev-tool): show 'Welcome back' instead of 'Anonymous' for unnamed users

The dev tool Identity card used 'Anonymous' as the fallback when a
logged-in user had no displayName, which contradicted the green
'Authenticated' badge shown alongside it and collided with the real
isAnonymous user concept. Now show the actual anonymous state only
when isAnonymous is true; otherwise prefer displayName and fall back
to 'Welcome back' for named-less authenticated users.
This commit is contained in:
Aadesh Kheria 2026-05-27 15:43:46 -07:00
parent c753ab2831
commit 03aed0e9ce

View File

@ -946,7 +946,9 @@ function createOverviewTab(app: StackClientApp<true>): TabResult {
} else {
avatar.textContent = initials;
}
userName.textContent = currentUser.displayName || 'Anonymous';
userName.textContent = currentUser.isAnonymous
? 'Anonymous'
: (currentUser.displayName || 'Welcome back');
userEmail.textContent = currentUser.primaryEmail || 'No email';
authIndicator.style.display = '';
} else {