mirror of
https://github.com/danog/telegram-tt.git
synced 2025-01-22 13:21:37 +01:00
Management / Add Member: Fix exception
This commit is contained in:
parent
139bc84174
commit
e679b6ae7e
@ -953,12 +953,16 @@ addReducer('loadMoreMembers', (global) => {
|
|||||||
|
|
||||||
global = getGlobal();
|
global = getGlobal();
|
||||||
global = addUsers(global, buildCollectionByKey(users, 'id'));
|
global = addUsers(global, buildCollectionByKey(users, 'id'));
|
||||||
|
|
||||||
|
const newMemberIds = new Set(members.map(m => m.userId));
|
||||||
|
const preservedMembers = chat.fullInfo?.members?.filter((m) => !newMemberIds.has(m.userId)) || [];
|
||||||
|
|
||||||
global = updateChat(global, chat.id, {
|
global = updateChat(global, chat.id, {
|
||||||
fullInfo: {
|
fullInfo: {
|
||||||
...chat.fullInfo,
|
...chat.fullInfo,
|
||||||
members: [
|
members: [
|
||||||
...((chat.fullInfo || {}).members || []),
|
...preservedMembers,
|
||||||
...(members || []),
|
...members,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user