fix: don't get chat after accepting invite

This will now only return the chatId, since getting the chat at this point is unreliable.
This commit is contained in:
Pedro Lopez
2020-02-02 20:37:51 -04:00
parent e2351db722
commit e717915f94
2 changed files with 5 additions and 7 deletions

View File

@@ -239,12 +239,11 @@ class Client extends EventEmitter {
* @param {string} inviteCode
*/
async acceptInvite(inviteCode) {
const chat = await this.pupPage.evaluate(async inviteCode => {
const chatId = await window.Store.Invite.sendJoinGroupViaInvite(inviteCode);
return window.WWebJS.getChat(chatId._serialized);
const chatId = await this.pupPage.evaluate(async inviteCode => {
return await window.Store.Invite.sendJoinGroupViaInvite(inviteCode);
}, inviteCode);
return ChatFactory.create(this.client, chat);
return chatId._serialized;
}
}