Skip to content

Commit

Permalink
Force trader poll on idle
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelTaranto committed Jul 30, 2019
1 parent 0e558c9 commit 5457aac
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/brain.js
Expand Up @@ -1305,6 +1305,7 @@ Brain.prototype._idle = function _idle (locale) {

if (this.networkDown) return this._forceNetworkDown()

const pollPromise = this.trader.poll()
this.idVerify.reset()
this.currentPhoneNumber = null
this.currentSecurityCode = null
Expand Down Expand Up @@ -1341,10 +1342,16 @@ Brain.prototype._idle = function _idle (locale) {

this.tx = Tx.update(this.tx, {fiatCode: this.fiatCode})

pollPromise
.then(() => this._idleByMode(self.localeInfo))
.catch(console.log)
}

Brain.prototype._idleByMode = function _idleByMode (localeInfo) {
if (this.trader.twoWayMode) {
this._idleTwoWay(self.localeInfo)
this._idleTwoWay(localeInfo)
} else {
this._idleOneWay(self.localeInfo)
this._idleOneWay(localeInfo)
}
}

Expand Down

0 comments on commit 5457aac

Please sign in to comment.