From eb8b05fb908f32e87a6b0a245fe050da9c76d7ea Mon Sep 17 00:00:00 2001 From: Ezerous Date: Sat, 18 May 2019 12:45:03 +0300 Subject: [PATCH] TransactionMonitorContainer minor improvements --- .../TransactionsMonitorContainer.js | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/app/src/containers/TransactionsMonitorContainer.js b/app/src/containers/TransactionsMonitorContainer.js index 0021910..92876ec 100644 --- a/app/src/containers/TransactionsMonitorContainer.js +++ b/app/src/containers/TransactionsMonitorContainer.js @@ -80,36 +80,36 @@ class RightSideBar extends Component { } const transactionMessages = transactionStack.map( - (transaction, index) => { - if (isTransactionMessageDismissed[index]) { + (transactionIndex, index) => { + if (isTransactionMessageDismissed[index]) return null; - } let color = 'black'; const message = []; - message.push( - 'New transaction has been queued and is waiting your confirmation.', - ); - if (transactions[transaction]) { + const transaction = transactions[transactionIndex]; + + if(!transaction) + message.push('New transaction has been queued and is waiting your confirmation.'); + + if (transaction && transaction.status === 'pending') { + message.push('New transaction has been queued and is waiting your confirmation.'); message.push(
); message.push('- transaction confirmed'); } - if (transactions[transaction] - && transactions[transaction].status === 'success') { + if (transaction && transaction.status === 'success') { /* Transaction completed successfully */ + message.push('New transaction has been queued and is waiting your confirmation.'); + message.push(
); + message.push('- transaction confirmed'); message.push(
); message.push('- transaction mined'); color = 'green'; message.push(
); message.push('- transaction completed successfully'); - } else if (transactions[transaction] - && transactions[transaction].status === 'error') { + } else if (transaction && transaction.status === 'error') { /* Transaction failed to complete */ - message.push(
); - message.push('- transaction mined'); color = 'red'; - message.push(
); - message.push('Transaction failed to complete!'); + message.push('Transaction failed!'); } return (