From dbf9ef85c99b3c815a13354a3f2c951d8f144b58 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Fri, 16 Sep 2022 18:28:52 +0200 Subject: [PATCH] Middle Header, Chat List: Fix name and avatar for deleted accounts --- src/global/helpers/users.ts | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/global/helpers/users.ts b/src/global/helpers/users.ts index 6208c898c..414cffd52 100644 --- a/src/global/helpers/users.ts +++ b/src/global/helpers/users.ts @@ -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) {