fix: Contact (#2325)
* fixed: contact info retrieving * fixed: block method * fixed: isBlocked property is now changeble * added inner function to compare between WWeb versions The function compares the currently used WWeb version with the version that requires the code changes. Its purpose is to ensure the stable operation of the library across different WWeb versions. * added: todo remove useOldImplementation * improved inner function to compare WWeb versions * inner function: added support for beta versions * added support for business accounts * module queries changed to strings * fixed check for wweb beta versions * updated to throw a custom error message * minor changes in inner function
This commit is contained in:
parent
8fc6e6098c
commit
c8c2f09f20
1 changed files with 93 additions and 8 deletions
|
|
@ -156,9 +156,10 @@ class Contact extends Base {
|
|||
|
||||
await this.client.pupPage.evaluate(async (contactId) => {
|
||||
const contact = window.Store.Contact.get(contactId);
|
||||
await window.Store.BlockContact.blockContact(contact);
|
||||
await window.Store.BlockContact.blockContact({contact});
|
||||
}, this.id._serialized);
|
||||
|
||||
this.isBlocked = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -174,6 +175,7 @@ class Contact extends Base {
|
|||
await window.Store.BlockContact.unblockContact(contact);
|
||||
}, this.id._serialized);
|
||||
|
||||
this.isBlocked = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue