Skip to content

Commit 581fa70

Browse files
committed
feat(neuron-ui): update confirmation threshold of confirmations
1. set the threshold of confirmations to 10. 2. display a recent activity as a pending one if its status is success while its confirmations is less the the threshold of confirmations.
1 parent 2066f61 commit 581fa70

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,16 @@ const Overview = ({
285285
items.map(item => {
286286
let confirmations = '(-)'
287287
let typeLabel: string = item.type
288+
let { status } = item
288289
if (item.blockNumber !== undefined) {
289290
const confirmationCount = 1 + Math.max(+syncedBlockNumber, +tipBlockNumber) - +item.blockNumber
291+
292+
if (status === 'success' && confirmationCount < CONFIRMATION_THRESHOLD) {
293+
status = 'pending'
294+
}
295+
290296
typeLabel = genTypeLabel(item.type, confirmationCount)
297+
291298
if (confirmationCount === 1) {
292299
confirmations = `(${t('overview.confirmation', {
293300
confirmationCount: localNumberFormatter(confirmationCount),
@@ -298,8 +305,10 @@ const Overview = ({
298305
})})`
299306
}
300307
}
308+
301309
return {
302310
...item,
311+
status,
303312
confirmations: item.status === 'success' ? confirmations : '',
304313
typeLabel: t(`overview.${typeLabel}`),
305314
}

packages/neuron-ui/src/utils/const.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const MIN_AMOUNT = 61
66
export const PAGE_SIZE = 15
77
export const UNREMOVABLE_NETWORK = 'Testnet'
88
export const UNREMOVABLE_NETWORK_ID = '0'
9-
export const CONFIRMATION_THRESHOLD = 6
9+
export const CONFIRMATION_THRESHOLD = 10
1010

1111
export enum ConnectionStatus {
1212
Online = 'online',

0 commit comments

Comments
 (0)