Update conversations.php
This commit is contained in:
+8
-5
@@ -2868,12 +2868,15 @@ if (!isUserLoggedIn()) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getInitials(name) {
|
getInitials(name) {
|
||||||
if (!name) return '?';
|
if (!name || typeof name !== 'string') return '?';
|
||||||
const parts = name.split(' ');
|
const parts = name.trim().split(/\s+/);
|
||||||
if (parts.length >= 2) {
|
if (parts.length >= 2 && parts[0] && parts[1]) {
|
||||||
return (parts[0][0] + parts[1][0]).toUpperCase();
|
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) {
|
formatTime(dateString) {
|
||||||
|
|||||||
Reference in New Issue
Block a user