mirror of
https://github.com/open-webui/open-webui.git
synced 2026-12-05 11:07:55 -05:00
refac
This commit is contained in:
1 parent
8bdd1b13d0
commit
b16039bc9a
1 file changed
+5
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user