bug fix where phonePoll wasn't clearing

This commit is contained in:
Adhiraj
2020-08-27 16:14:24 +05:30
parent d995af0104
commit dd91c9a0d9
4 changed files with 36 additions and 30 deletions

View File

@@ -11,7 +11,6 @@ export class WAConnection extends Base {
this.registerOnMessageStatusChange ()
this.registerOnUnreadMessage ()
this.registerOnPresenceUpdate ()
this.registerPhoneConnectionPoll ()
// If a message has been updated (usually called when a video message gets its upload url)
this.registerCallback (['action', 'add:update', 'message'], json => {
@@ -266,18 +265,6 @@ export class WAConnection extends Base {
protected async setProfilePicture (chat: WAChat) {
chat.imgUrl = await this.getProfilePicture (chat.jid).catch (err => '')
}
protected registerPhoneConnectionPoll () {
this.phoneCheck = setInterval (() => {
this.checkPhoneConnection (5000) // 5000 ms for timeout
.then (connected => {
if (this.phoneConnected != connected) {
this.emit ('connection-phone-change', {connected})
}
this.phoneConnected = connected
})
.catch (error => this.log(`error in getting phone connection: ${error}`, MessageLogLevel.info))
}, 15000)
}
// Add all event types