Group Chat Info: Fix invalid admin badge when loading members (#2373)

This commit is contained in:
Alexander Zinchuk 2023-01-28 02:15:58 +01:00
parent 730f74f301
commit f772abd6c7

View File

@ -255,11 +255,13 @@ export function addChatMembers<T extends GlobalState>(global: T, chat: ApiChat,
return global; return global;
} }
const adminMembers = updatedMembers.filter(({ isAdmin, isOwner }) => isAdmin || isOwner);
return updateChat(global, chat.id, { return updateChat(global, chat.id, {
fullInfo: { fullInfo: {
...chat.fullInfo, ...chat.fullInfo,
members: updatedMembers, members: updatedMembers,
adminMembersById: buildCollectionByKey(updatedMembers, 'userId'), adminMembersById: buildCollectionByKey(adminMembers, 'userId'),
}, },
}); });
} }