diff --git a/js/src/ui/TxList/TxRow/txRow.js b/js/src/ui/TxList/TxRow/txRow.js index c2061a581..cefa41110 100644 --- a/js/src/ui/TxList/TxRow/txRow.js +++ b/js/src/ui/TxList/TxRow/txRow.js @@ -210,31 +210,36 @@ class TxRow extends Component { if (!isCancelOpen && !isEditOpen) { const pendingStatus = this.getCondition(); + const isPending = pendingStatus === 'pending'; - if (pendingStatus === 'submitting') { - return ( -
-
-
- -
-
- ); - } return (
- - { pendingStatus } - -
- -
+ { + isPending + ? ( +
+
+
+ +
+
+ ) : ( +
+ + { pendingStatus } + +
+ +
+
+ ) + } + { isPending + ? ( +
+ +
+ ) : null + }
); } @@ -319,11 +334,10 @@ class TxRow extends Component { getCondition = () => { const { blockNumber, tx } = this.props; - let { time, block } = tx.condition || {}; + let { time, block = 0 } = tx.condition || {}; if (time) { if ((time.getTime() - Date.now()) >= 0) { - // return `${dateDifference(new Date(), time, { compact: true })} left`; return ( ); - } else { - return 'submitting'; } - } else if (blockNumber && block) { + } + + if (blockNumber) { block = blockNumber.minus(block); - // return (block.toNumber() < 0) - // ? block.abs().toFormat(0) + ' blocks left' - // : 'submitting'; if (block.toNumber() < 0) { return ( ); - } else { - return 'submitting'; } } + + return 'pending'; } cancelTx = () => {