Merge pull request #89 from lockerace/master

fix: TypeError caused by empty chat
This commit is contained in:
Adhiraj Singh
2020-08-01 11:24:34 +05:30
committed by GitHub

View File

@@ -111,6 +111,7 @@ export default class WAConnectionConnector extends WAConnectionValidator {
let json = await this.registerCallbackOneTime(['response', 'type:chat']) let json = await this.registerCallbackOneTime(['response', 'type:chat'])
if (json[1].duplicate) json = await this.registerCallbackOneTime (['response', 'type:chat']) if (json[1].duplicate) json = await this.registerCallbackOneTime (['response', 'type:chat'])
if (!json[2]) return
json[2].forEach(([_, chat]: [any, WAChat]) => { json[2].forEach(([_, chat]: [any, WAChat]) => {
chat.count = +chat.count chat.count = +chat.count
chat.messages = [] chat.messages = []