aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrankie <frankie.diamond@gmail.com>2018-04-07 01:34:37 +0800
committerGitHub <noreply@github.com>2018-04-07 01:34:37 +0800
commit2b787f2833d4f4cfda74ca22d3d340f0f924c94e (patch)
tree6dc940a1acbc76417a8b0ab231648bfc9307106b
parent23cc989d80bd17ff733e6ae65ce6ceb4ababadf9 (diff)
parent26fe6383778f6f94698c2d0d2adec4ae2f1d3406 (diff)
downloadtangerine-wallet-browser-2b787f2833d4f4cfda74ca22d3d340f0f924c94e.tar
tangerine-wallet-browser-2b787f2833d4f4cfda74ca22d3d340f0f924c94e.tar.gz
tangerine-wallet-browser-2b787f2833d4f4cfda74ca22d3d340f0f924c94e.tar.bz2
tangerine-wallet-browser-2b787f2833d4f4cfda74ca22d3d340f0f924c94e.tar.lz
tangerine-wallet-browser-2b787f2833d4f4cfda74ca22d3d340f0f924c94e.tar.xz
tangerine-wallet-browser-2b787f2833d4f4cfda74ca22d3d340f0f924c94e.tar.zst
tangerine-wallet-browser-2b787f2833d4f4cfda74ca22d3d340f0f924c94e.zip
Merge pull request #3917 from MetaMask/kumavis-patch-3
tx-state-manager - dont remove old tx history if candidate is not found
-rw-r--r--app/scripts/lib/tx-state-manager.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/scripts/lib/tx-state-manager.js b/app/scripts/lib/tx-state-manager.js
index d8ea17400..c6d10ee62 100644
--- a/app/scripts/lib/tx-state-manager.js
+++ b/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)