This commit is contained in:
Eduard Kuzmenko 2021-08-27 01:28:49 +03:00
parent a1e1690af6
commit b9c86cf417

View File

@ -480,9 +480,7 @@ export class AppChatsManager {
return apiManager.invokeApi('channels.inviteToChannel', { return apiManager.invokeApi('channels.inviteToChannel', {
channel: input, channel: input,
users: usersInputs users: usersInputs
}).then(updates => { }).then(this.onChatUpdated.bind(this, id));
apiUpdatesManager.processUpdateMessage(updates);
});
} }
public createChat(title: string, userIds: number[]): Promise<number> { public createChat(title: string, userIds: number[]): Promise<number> {
@ -499,14 +497,11 @@ export class AppChatsManager {
}); });
} }
private onChatUpdated = (chatId: number, updates: any) => { private onChatUpdated = (chatId: number, updates?: any) => {
//console.log('onChatUpdated', chatId, updates); //console.log('onChatUpdated', chatId, updates);
apiUpdatesManager.processUpdateMessage(updates); apiUpdatesManager.processUpdateMessage(updates);
if(updates && if(updates?.updates?.length && this.isChannel(chatId)) {
/* updates.updates &&
updates.updates.length && */
this.isChannel(chatId)) {
rootScope.dispatchEvent('invalidate_participants', chatId); rootScope.dispatchEvent('invalidate_participants', chatId);
} }
}; };