From 5486fdcd349099443881fd51f1ba03e079987895 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Gayot?= Date: Mon, 9 Oct 2023 18:56:51 +0200 Subject: [PATCH] :sparkles: Limit initials length to 3 characters --- src/avatar-image.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/avatar-image.jsx b/src/avatar-image.jsx index 93e67b2..e0168db 100755 --- a/src/avatar-image.jsx +++ b/src/avatar-image.jsx @@ -172,6 +172,7 @@ const AvatarImage = createReactClass({ var initials = ''; for(var i=0 ; i < parts.length ; i++) { + if (i > 3) break; initials += parts[i].substr(0, 1).toUpperCase(); } return initials;