Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
b8790200
Commit
b8790200
authored
Apr 04, 2024
by
Danny Liu
Browse files
refac: code style
parent
4200ad11
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
13 deletions
+14
-13
src/lib/utils/index.ts
src/lib/utils/index.ts
+14
-13
No files found.
src/lib/utils/index.ts
View file @
b8790200
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment