Update conversations.php

This commit is contained in:
Lizandro Guarnizo
2026-06-13 08:22:25 -05:00
parent 8df97829e2
commit 3b70cf2ae8
+8 -5
View File
@@ -2868,12 +2868,15 @@ if (!isUserLoggedIn()) {
}
getInitials(name) {
if (!name) return '?';
const parts = name.split(' ');
if (parts.length >= 2) {
return (parts[0][0] + parts[1][0]).toUpperCase();
if (!name || typeof name !== 'string') return '?';
const parts = name.trim().split(/\s+/);
if (parts.length >= 2 && parts[0] && parts[1]) {
return ((parts[0][0] || '') + (parts[1][0] || '')).toUpperCase();
}
return name.substring(0, 2).toUpperCase();
if (parts[0]) {
return parts[0].substring(0, 2).toUpperCase();
}
return '?';
}
formatTime(dateString) {