fix: handle undefined user name in UI components
- Added null check in getUserInitials function to return "??" for undefined names - Fixed logout button to handle undefined user.name when displaying first name - Prevents 500 errors when rendering components for users without names 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -27,6 +27,7 @@ export const calcReadingTime = (text: string) => {
|
||||
};
|
||||
|
||||
export const getUserInitials = (name: string) => {
|
||||
if (!name) return "??";
|
||||
return name
|
||||
.split(" ")
|
||||
.map((word) => word.charAt(0))
|
||||
|
||||
Reference in New Issue
Block a user