Browse Source

TransactionMonitorContainer minor improvements

develop
Ezerous 6 years ago
parent
commit
eb8b05fb90
  1. 30
      app/src/containers/TransactionsMonitorContainer.js

30
app/src/containers/TransactionsMonitorContainer.js

@ -80,36 +80,36 @@ class RightSideBar extends Component {
} }
const transactionMessages = transactionStack.map( const transactionMessages = transactionStack.map(
(transaction, index) => { (transactionIndex, index) => {
if (isTransactionMessageDismissed[index]) { if (isTransactionMessageDismissed[index])
return null; return null;
}
let color = 'black'; let color = 'black';
const message = []; const message = [];
message.push( const transaction = transactions[transactionIndex];
'New transaction has been queued and is waiting your confirmation.',
); if(!transaction)
if (transactions[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(<br key="confirmed" />); message.push(<br key="confirmed" />);
message.push('- transaction confirmed'); message.push('- transaction confirmed');
} }
if (transactions[transaction] if (transaction && transaction.status === 'success') {
&& transactions[transaction].status === 'success') {
/* Transaction completed successfully */ /* Transaction completed successfully */
message.push('New transaction has been queued and is waiting your confirmation.');
message.push(<br key="confirmed" />);
message.push('- transaction confirmed');
message.push(<br key="mined" />); message.push(<br key="mined" />);
message.push('- transaction mined'); message.push('- transaction mined');
color = 'green'; color = 'green';
message.push(<br key="success" />); message.push(<br key="success" />);
message.push('- transaction completed successfully'); message.push('- transaction completed successfully');
} else if (transactions[transaction] } else if (transaction && transaction.status === 'error') {
&& transactions[transaction].status === 'error') {
/* Transaction failed to complete */ /* Transaction failed to complete */
message.push(<br key="mined" />);
message.push('- transaction mined');
color = 'red'; color = 'red';
message.push(<br key="fail" />); message.push('Transaction failed!');
message.push('Transaction failed to complete!');
} }
return ( return (

Loading…
Cancel
Save