add check for name in Avatar component
This commit is contained in:
parent
61cabc7fc5
commit
07252b26b4
|
@ -16,8 +16,11 @@
|
||||||
|
|
||||||
function getInitials(name) {
|
function getInitials(name) {
|
||||||
let parts = name.split(" ")
|
let parts = name.split(" ")
|
||||||
|
if (parts.length > 0) {
|
||||||
return parts.map(name => name[0]).join("")
|
return parts.map(name => name[0]).join("")
|
||||||
}
|
}
|
||||||
|
return name
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if url}
|
{#if url}
|
||||||
|
|
Loading…
Reference in New Issue