From 9b92ba4c47d5489c5c0f822045360be708110cac Mon Sep 17 00:00:00 2001
From: frankiebee <frankie.diamond@gmail.com>
Date: Mon, 25 Jun 2018 15:07:54 -0700
Subject: trandsactions - remove rejected transactions from history

---
 app/scripts/controllers/transactions/tx-state-manager.js | 6 ++++++
 1 file changed, 6 insertions(+)

(limited to 'app')

diff --git a/app/scripts/controllers/transactions/tx-state-manager.js b/app/scripts/controllers/transactions/tx-state-manager.js
index 0aae4774b..28a18ca2e 100644
--- a/app/scripts/controllers/transactions/tx-state-manager.js
+++ b/app/scripts/controllers/transactions/tx-state-manager.js
@@ -288,6 +288,7 @@ class TransactionStateManager extends EventEmitter {
   */
   setTxStatusRejected (txId) {
     this._setTxStatus(txId, 'rejected')
+    this._removeTx(txId)
   }
 
   /**
@@ -422,6 +423,11 @@ class TransactionStateManager extends EventEmitter {
   _saveTxList (transactions) {
     this.store.updateState({ transactions })
   }
+
+  _removeTx (txId) {
+    const transactionList = this.getFullTxList()
+    this._saveTxList(transactionList.filter((txMeta) => txMeta.id !== txId))
+  }
 }
 
 module.exports = TransactionStateManager
-- 
cgit v1.2.3