diff options
author | Frankie <frankie.pangilinan@consensys.net> | 2016-08-19 06:20:26 +0800 |
---|---|---|
committer | Frankie <frankie.pangilinan@consensys.net> | 2016-08-19 06:20:26 +0800 |
commit | 3525dc080110e7af1f9544e18b5646c87fb9ae95 (patch) | |
tree | 7e2dde7bf928ddec789ec849bb799070f89e455e /app | |
parent | 23aeb1c5c1ee066a7b7603c7d6dec329cea3a7ba (diff) | |
download | tangerine-wallet-browser-3525dc080110e7af1f9544e18b5646c87fb9ae95.tar.gz tangerine-wallet-browser-3525dc080110e7af1f9544e18b5646c87fb9ae95.tar.zst tangerine-wallet-browser-3525dc080110e7af1f9544e18b5646c87fb9ae95.zip |
Create a ShapeShift tx in tx History
Diffstat (limited to 'app')
-rw-r--r-- | app/scripts/lib/config-manager.js | 10 | ||||
-rw-r--r-- | app/scripts/metamask-controller.js | 5 |
2 files changed, 8 insertions, 7 deletions
diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index d6d10c8f2..6f5cb3a4a 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -337,11 +337,11 @@ ConfigManager.prototype.getShapeShiftTxList = function () { var data = this.getData() var shapeShiftTxList = data.shapeShiftTxList ? data.shapeShiftTxList : [] shapeShiftTxList.forEach((tx) => { - if (tx.response.status !== 'complete'){ + if (tx.response.status !== 'complete') { var requestListner = function (request) { tx.response = JSON.parse(this.responseText) - if (tx.status === 'complete') { - tx.completeTime = new Date().getTime() + if (tx.response.status === 'complete') { + tx.time = new Date().getTime() } } @@ -351,6 +351,7 @@ ConfigManager.prototype.getShapeShiftTxList = function () { shapShiftReq.send() } }) + this.setData(data) return shapeShiftTxList } @@ -358,10 +359,11 @@ ConfigManager.prototype.createShapeShiftTx = function (depositAddress, depositTy var data = this.getData() var shapeShiftTx = {depositAddress, depositType, key: 'shapeshift', time: new Date().getTime(), response: {}} - if(!data.shapeShiftTxList) { + if (!data.shapeShiftTxList) { data.shapeShiftTxList = [shapeShiftTx] } else { data.shapeShiftTxList.push(shapeShiftTx) } this.setData(data) } + diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 0b1d40148..218f1f72a 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -65,7 +65,7 @@ module.exports = class MetamaskController { // coinbase buyEth: this.buyEth.bind(this), // shapeshift - createShapeShiftTx : this.createShapeShiftTx.bind(this), + createShapeShiftTx: this.createShapeShiftTx.bind(this), } } @@ -319,10 +319,9 @@ module.exports = class MetamaskController { }) } - createShapeShiftTx (depositAddress, depositType) { + createShapeShiftTx (depositAddress, depositType) { this.configManager.createShapeShiftTx(depositAddress, depositType) } - } function noop () {} |