Fix Group getInviteCode (#3492)
* Update Store.js add new require to fix getInviteCode method * Update GroupChat.js adjusting method getInviteCode
This commit is contained in:
parent
f56d25f1c4
commit
441a3a6d6c
2 changed files with 8 additions and 5 deletions
|
|
@ -381,9 +381,9 @@ class GroupChat extends Chat {
|
|||
const codeRes = await this.client.pupPage.evaluate(async chatId => {
|
||||
const chatWid = window.Store.WidFactory.createWid(chatId);
|
||||
try {
|
||||
return window.compareWwebVersions(window.Debug.VERSION, '>=', '2.3000.0')
|
||||
? await window.Store.GroupInvite.queryGroupInviteCode(chatWid, true)
|
||||
: await window.Store.GroupInvite.queryGroupInviteCode(chatWid);
|
||||
return window.compareWwebVersions(window.Debug.VERSION, '>=', '2.3000.1020730154')
|
||||
? await window.Store.GroupInvite.fetchMexGroupInviteCode(chatId)
|
||||
: await window.Store.GroupInvite.queryGroupInviteCode(chatWid, true);
|
||||
}
|
||||
catch (err) {
|
||||
if(err.name === 'ServerStatusCodeError') return undefined;
|
||||
|
|
@ -391,7 +391,9 @@ class GroupChat extends Chat {
|
|||
}
|
||||
}, this.id._serialized);
|
||||
|
||||
return codeRes?.code;
|
||||
return codeRes?.code
|
||||
? codeRes?.code
|
||||
: codeRes;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue