nicoalbanese / kirimase

Build full-stack Next.js apps, incredibly fast
https://kirimase.dev
MIT License
2.39k stars 107 forks source link

Unnecessary nameExists length check in Navbar.tsx? #98

Closed sbbu closed 6 months ago

sbbu commented 7 months ago

Navbar.tsx is by default generated with a nameExists boolean like so: const nameExists = !!session?.user.name && session?.user.name.length > 5;. What is the point of the session?.user.name.length > 5 check? I thought it was bugged at first, because my username "sbbu" is 4 characters and so shows as "New User".

image

Of course this is a nitpick and easy for us to remove ourselves, I'm just wondering if there's a reason to have it there in the first place.

nicoalbanese commented 6 months ago

Can't remember why I had done this but think it was something around performing the split later on in the component. But agree - kind of silly at 5! Have updated it to be 3 for the time being.