Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Commit

Permalink
fix(Trade): expose txHash property, only trigger watch after trade ha…
Browse files Browse the repository at this point in the history
…s been updated (#264)
  • Loading branch information
jtormey authored and Sjors committed Sep 2, 2016
1 parent 81e9fc6 commit 31eccee
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/coinify/trade.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ Object.defineProperties(CoinifyTrade.prototype, {
return this.outCurrency === 'BTC';
}
}
},
'txHash': {
configurable: false,
get: function () { return this._txHash || null; }
}
});

Expand Down Expand Up @@ -333,11 +337,13 @@ CoinifyTrade.prototype._monitorAddress = function () {
};

var tradeWasPaid = function (amount) {
self._watchAddressResolve && self._watchAddressResolve(amount);

var resolve = function () {
self._watchAddressResolve && self._watchAddressResolve(amount);
};
self.refresh()
.then(CoinifyTrade._getTransactionHash)
.then(saveTrade);
.then(saveTrade)
.then(resolve);
};

self._coinify.delegate.monitorAddress(self.receiveAddress, function (amount) {
Expand Down

0 comments on commit 31eccee

Please sign in to comment.