Skip to content

Commit 2cded1c

Browse files
committed
fix(neuron-ui): hide the countdown if the current epoch number is greater than the target epoch number.
1 parent df3eb0e commit 2cded1c

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

packages/neuron-ui/src/components/NervosDAO/WithdrawDialog.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,17 @@ const WithdrawDialog = ({
6060
const currentEpochInfo = epochParser(currentEpoch)
6161
const targetEpochNumber = calculateTargetEpochNumber(depositEpochInfo, currentEpochInfo)
6262
const epochs = targetEpochNumber - currentEpochInfo.number - BigInt(1)
63-
const message = t('nervos-dao.notice-wait-time', {
64-
epochs: localNumberFormatter(epochs),
65-
blocks: localNumberFormatter(currentEpochInfo.length - currentEpochInfo.index),
66-
days: localNumberFormatter(epochs / BigInt(6)),
67-
})
63+
const message =
64+
epochs >= BigInt(0)
65+
? t('nervos-dao.notice-wait-time', {
66+
epochs: localNumberFormatter(epochs),
67+
blocks: localNumberFormatter(currentEpochInfo.length - currentEpochInfo.index),
68+
days: localNumberFormatter(epochs / BigInt(6)),
69+
})
70+
: ''
6871

6972
const alert =
70-
epochs <= BigInt(5)
73+
epochs <= BigInt(5) && epochs >= BigInt(0)
7174
? t('nervos-dao.withdraw-alert', {
7275
epochs,
7376
nextLeftEpochs: epochs + BigInt(180),

0 commit comments

Comments
 (0)