diff options
author | Frankie <frankie.diamond@gmail.com> | 2017-01-12 07:44:21 +0800 |
---|---|---|
committer | Frankie <frankie.diamond@gmail.com> | 2017-01-12 07:44:21 +0800 |
commit | 576e2ad64df293adcc8c2494a3648100ba4b28f5 (patch) | |
tree | ace817d9d0099bee48c022c5345ea17c8236fd54 /app | |
parent | bbd2f2738b5b260f0e666b9cfb8d0c843342abb2 (diff) | |
download | tangerine-wallet-browser-576e2ad64df293adcc8c2494a3648100ba4b28f5.tar tangerine-wallet-browser-576e2ad64df293adcc8c2494a3648100ba4b28f5.tar.gz tangerine-wallet-browser-576e2ad64df293adcc8c2494a3648100ba4b28f5.tar.bz2 tangerine-wallet-browser-576e2ad64df293adcc8c2494a3648100ba4b28f5.tar.lz tangerine-wallet-browser-576e2ad64df293adcc8c2494a3648100ba4b28f5.tar.xz tangerine-wallet-browser-576e2ad64df293adcc8c2494a3648100ba4b28f5.tar.zst tangerine-wallet-browser-576e2ad64df293adcc8c2494a3648100ba4b28f5.zip |
Fix wording and icon of failed txs
Diffstat (limited to 'app')
-rw-r--r-- | app/scripts/keyring-controller.js | 1 | ||||
-rw-r--r-- | app/scripts/transaction-manager.js | 30 |
2 files changed, 16 insertions, 15 deletions
diff --git a/app/scripts/keyring-controller.js b/app/scripts/keyring-controller.js index a457a2560..81e6a4905 100644 --- a/app/scripts/keyring-controller.js +++ b/app/scripts/keyring-controller.js @@ -272,7 +272,6 @@ module.exports = class KeyringController extends EventEmitter { setSelectedAccount (address) { var addr = normalize(address) this.configManager.setSelectedAccount(addr) - this.emit('update') return Promise.resolve(addr) } diff --git a/app/scripts/transaction-manager.js b/app/scripts/transaction-manager.js index f83bc41c9..527899835 100644 --- a/app/scripts/transaction-manager.js +++ b/app/scripts/transaction-manager.js @@ -82,6 +82,7 @@ module.exports = class TransactionManager extends EventEmitter { var index = txList.findIndex(txData => txData.id === txId) txList[index] = txMeta this._saveTxList(txList) + this.emit('update') } get unapprovedTxCount () { @@ -182,7 +183,6 @@ module.exports = class TransactionManager extends EventEmitter { this.updateTx(metaTx) var rawTx = ethUtil.bufferToHex(tx.serialize()) return Promise.resolve(rawTx) - } /* @@ -242,7 +242,6 @@ module.exports = class TransactionManager extends EventEmitter { setTxStatusConfirmed (txId) { this._setTxStatus(txId, 'confirmed') - this.emit('update') } // merges txParams obj onto txData.txParams @@ -258,26 +257,29 @@ module.exports = class TransactionManager extends EventEmitter { checkForTxInBlock () { var signedTxList = this.getFilteredTxList({status: 'signed'}) if (!signedTxList.length) return - signedTxList.forEach((tx) => { - var txHash = tx.hash - var txId = tx.id + signedTxList.forEach((txMeta) => { + var txHash = txMeta.hash + var txId = txMeta.id if (!txHash) { - tx.err = { + txMeta.err = { errCode: 'No hash was provided', - message: 'Tx could possibly have not been submitted or an error accrued during signing', + message: 'We had an error while submitting this transaction, please try again.', } - return this.updateTx(tx) + this.updateTx(txMeta) + return this._setTxStatus(txId, 'failed') } - this.txProviderUtils.query.getTransactionByHash(txHash, (err, txMeta) => { - if (err) { - tx.err = { + this.txProviderUtils.query.getTransactionByHash(txHash, (err, txParams) => { + if (err || !txParams) { + if (!txParams) return + txMeta.err = { + isWarning: true, errorCode: err, - message: 'Tx could possibly have not been submitted to the block chain', + message: 'There was a problem loading this transaction.', } - this.updateTx(tx) + this.updateTx(txMeta) return console.error(err) } - if (txMeta.blockNumber) { + if (txParams.blockNumber) { this.setTxStatusConfirmed(txId) } }) |