mirror of
https://github.com/open-webui/open-webui
synced 2024-11-25 21:38:43 +00:00
refac: code style
This commit is contained in:
parent
4200ad111c
commit
b8790200e9
@ -110,7 +110,8 @@ export const generateInitialsImage = (name) => {
|
||||
ctx.textAlign = 'center';
|
||||
ctx.textBaseline = 'middle';
|
||||
|
||||
const initials = name.trim().length > 0 ? name[0] + (name.trim().split(' ').length > 1 ? name[name.lastIndexOf(' ') + 1] : '') : '';
|
||||
const sanitizedName = name.trim();
|
||||
const initials = sanitizedName.length > 0 ? sanitizedName[0] + (sanitizedName.split(' ').length > 1 ? sanitizedName[sanitizedName.lastIndexOf(' ') + 1] : '') : '';
|
||||
|
||||
ctx.fillText(initials.toUpperCase(), canvas.width / 2, canvas.height / 2);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user