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