From b16039bc9abbcdab2e0819d373200cf81525ae81 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sat, 21 Nov 2026 21:53:06 +0400 Subject: [PATCH] refac --- src/lib/utils/greeting.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/utils/greeting.ts b/src/lib/utils/greeting.ts index 69cf9af0ed..6a8fdc0c5d 100644 --- a/src/lib/utils/greeting.ts +++ b/src/lib/utils/greeting.ts @@ -15,7 +15,11 @@ const period = (hour: number) => ? 'evening' : 'night'; -export const firstNameOf = (name?: string | null) => (name ?? '').trim().split(/\s+/)[0]; +// First word of the name with its first letter upper-cased, so "tim" greets as "Tim". +export const firstNameOf = (name?: string | null) => { + const first = (name ?? '').trim().split(/\s+/)[0]; + return first.charAt(0).toLocaleUpperCase() + first.slice(1); +}; /** * Time-of-day greeting for the new-chat screens. The same phrasing all day, a different one