From 456210d5173eec376b1f351b997be539086a2667 Mon Sep 17 00:00:00 2001 From: Keith Date: Tue, 29 Oct 2019 18:53:02 +0800 Subject: [PATCH] fix(neuron-ui): hide the confirmations of pending txs --- packages/neuron-ui/src/components/Overview/index.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/neuron-ui/src/components/Overview/index.tsx b/packages/neuron-ui/src/components/Overview/index.tsx index 8694c28e1f..a15c9dc6ca 100644 --- a/packages/neuron-ui/src/components/Overview/index.tsx +++ b/packages/neuron-ui/src/components/Overview/index.tsx @@ -123,7 +123,9 @@ const Overview = ({ let { status } = item if (item.blockNumber !== undefined) { const confirmationCount = - item.blockNumber === undefined ? 0 : 1 + Math.max(+syncedBlockNumber, +tipBlockNumber) - +item.blockNumber + item.blockNumber === null || item.status === 'failed' + ? 0 + : 1 + Math.max(+syncedBlockNumber, +tipBlockNumber) - +item.blockNumber if (status === 'success' && confirmationCount < CONFIRMATION_THRESHOLD) { status = 'pending' @@ -147,7 +149,7 @@ const Overview = ({ status, statusLabel: t(`overview.statusLabel.${status}`), value: item.value.replace(/^-/, ''), - confirmations: ['success', 'pending'].includes(item.status) ? confirmations : '', + confirmations, typeLabel: t(`overview.${typeLabel}`), } }),