Skip to content

Commit 456210d

Browse files
committed
fix(neuron-ui): hide the confirmations of pending txs
1 parent dfd9c5d commit 456210d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • packages/neuron-ui/src/components/Overview

packages/neuron-ui/src/components/Overview/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ const Overview = ({
123123
let { status } = item
124124
if (item.blockNumber !== undefined) {
125125
const confirmationCount =
126-
item.blockNumber === undefined ? 0 : 1 + Math.max(+syncedBlockNumber, +tipBlockNumber) - +item.blockNumber
126+
item.blockNumber === null || item.status === 'failed'
127+
? 0
128+
: 1 + Math.max(+syncedBlockNumber, +tipBlockNumber) - +item.blockNumber
127129

128130
if (status === 'success' && confirmationCount < CONFIRMATION_THRESHOLD) {
129131
status = 'pending'
@@ -147,7 +149,7 @@ const Overview = ({
147149
status,
148150
statusLabel: t(`overview.statusLabel.${status}`),
149151
value: item.value.replace(/^-/, ''),
150-
confirmations: ['success', 'pending'].includes(item.status) ? confirmations : '',
152+
confirmations,
151153
typeLabel: t(`overview.${typeLabel}`),
152154
}
153155
}),

0 commit comments

Comments
 (0)