[+] Implement function to get all open chats.

Close #14
This commit is contained in:
Pedro Lopez
2019-09-08 03:18:40 -04:00
parent cdfa1760eb
commit cde0034d93
3 changed files with 12 additions and 5 deletions

View File

@@ -148,12 +148,11 @@ class Client extends EventEmitter {
* Get all current chat instances
*/
async getChats() {
// let chats = await this.pupPage.evaluate(() => {
// return Store.Chat.serialize()
// });
let chats = await this.pupPage.evaluate(() => {
return WWebJS.getChats();
});
// return chats.map(chatData => ChatFactory.create(this, chatData));
throw new Error('NOT IMPLEMENTED')
return chats.map(chat => ChatFactory.create(this, chat));
}
/**