mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-20 20:49:14 +00:00
Merge branch 'main' into fix-buttons-list
This commit is contained in:
@@ -989,7 +989,13 @@ class Client extends EventEmitter {
|
|||||||
*/
|
*/
|
||||||
async getCommonGroups(contactId) {
|
async getCommonGroups(contactId) {
|
||||||
const commonGroups = await this.pupPage.evaluate(async (contactId) => {
|
const commonGroups = await this.pupPage.evaluate(async (contactId) => {
|
||||||
const contact = window.Store.Contact.get(contactId);
|
let contact = window.Store.Contact.get(contactId);
|
||||||
|
if (!contact) {
|
||||||
|
const wid = window.Store.WidFactory.createUserWid(contactId);
|
||||||
|
const chatConstructor = window.Store.Contact.getModelsArray().find(c=>!c.isGroup).constructor;
|
||||||
|
contact = new chatConstructor({id: wid});
|
||||||
|
}
|
||||||
|
|
||||||
if (contact.commonGroups) {
|
if (contact.commonGroups) {
|
||||||
return contact.commonGroups.serialize();
|
return contact.commonGroups.serialize();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -178,9 +178,9 @@ class RemoteAuth extends BaseAuthStrategy {
|
|||||||
await fs.promises.rm(dirElement, {
|
await fs.promises.rm(dirElement, {
|
||||||
recursive: true,
|
recursive: true,
|
||||||
force: true
|
force: true
|
||||||
});
|
}).catch(() => {});
|
||||||
} else {
|
} else {
|
||||||
await fs.promises.unlink(dirElement);
|
await fs.promises.unlink(dirElement).catch(() => {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user