Merge pull request #3917 from MetaMask/kumavis-patch-3

tx-state-manager - dont remove old tx history if candidate is not found
feature/default_network_editable
Frankie 7 years ago committed by GitHub
commit 2b787f2833
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      app/scripts/lib/tx-state-manager.js

@ -92,8 +92,10 @@ module.exports = class TransactionStateManager extends EventEmitter {
// or rejected tx's.
// not tx's that are pending or unapproved
if (txCount > txHistoryLimit - 1) {
const index = transactions.findIndex((metaTx) => metaTx.status === 'confirmed' || metaTx.status === 'rejected')
transactions.splice(index, 1)
let index = transactions.findIndex((metaTx) => metaTx.status === 'confirmed' || metaTx.status === 'rejected')
if (index !== -1) {
transactions.splice(index, 1)
}
}
transactions.push(txMeta)
this._saveTxList(transactions)

Loading…
Cancel
Save