1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

tx-state-manager - dont remove old tx history if candidate is not found

This commit is contained in:
kumavis 2018-04-06 10:18:00 -07:00 committed by GitHub
parent 054dce8d66
commit 26fe638377
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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