add check for name in Avatar component

This commit is contained in:
Keviin Åberg Kultalahti 2021-05-14 17:04:20 +02:00
parent 61cabc7fc5
commit 07252b26b4
1 changed files with 4 additions and 1 deletions

View File

@ -16,7 +16,10 @@
function getInitials(name) { function getInitials(name) {
let parts = name.split(" ") let parts = name.split(" ")
return parts.map(name => name[0]).join("") if (parts.length > 0) {
return parts.map(name => name[0]).join("")
}
return name
} }
</script> </script>