mirror of
https://github.com/danog/telegram-tt.git
synced 2024-11-26 20:34:44 +01:00
Middle Header, Chat List: Fix name and avatar for deleted accounts
This commit is contained in:
parent
3591aea8d5
commit
dbf9ef85c9
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user