Middle Header, Chat List: Fix name and avatar for deleted accounts

This commit is contained in:
Alexander Zinchuk 2022-09-16 18:28:52 +02:00
parent 3591aea8d5
commit dbf9ef85c9

View File

@ -37,7 +37,7 @@ export function getUserFullName(user?: ApiUser) {
} }
if (isDeletedUser(user)) { if (isDeletedUser(user)) {
return 'Deleted account'; return 'Deleted Account';
} }
switch (user.type) { switch (user.type) {
@ -61,11 +61,6 @@ export function getUserFullName(user?: ApiUser) {
break; break;
} }
case 'userTypeDeleted':
case 'userTypeUnknown': {
return 'Deleted account';
}
} }
return undefined; return undefined;
@ -179,12 +174,8 @@ export function isUserOnline(user: ApiUser, userStatus?: ApiUserStatus) {
} }
export function isDeletedUser(user: ApiUser) { export function isDeletedUser(user: ApiUser) {
if (user.noStatus || user.type === 'userTypeBot' || user.id === SERVICE_NOTIFICATIONS_USER_ID) { return (user.type === 'userTypeDeleted' || user.type === 'userTypeUnknown')
return false; && user.id !== SERVICE_NOTIFICATIONS_USER_ID;
}
return user.type === 'userTypeDeleted'
|| user.type === 'userTypeUnknown';
} }
export function isUserBot(user: ApiUser) { export function isUserBot(user: ApiUser) {