From ebe05e874b02db992d8caa72744540f8156b57d8 Mon Sep 17 00:00:00 2001 From: asiaznik Date: Thu, 22 Jun 2023 10:31:54 +0200 Subject: [PATCH] feat(web3): ready to withdraw toast - build spec fixes --- .../src/lib/use-verify-withdrawal.ts | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/libs/withdraws/src/lib/use-verify-withdrawal.ts b/libs/withdraws/src/lib/use-verify-withdrawal.ts index 252eea6b4..0f3e3bfca 100644 --- a/libs/withdraws/src/lib/use-verify-withdrawal.ts +++ b/libs/withdraws/src/lib/use-verify-withdrawal.ts @@ -82,16 +82,19 @@ export const useVerifyWithdrawal = () => { if (threshold && amount.isGreaterThan(threshold)) { const delaySecs = await getDelay(); - const completeTimestamp = - new Date(withdrawal.createdTimestamp).getTime() + delaySecs * 1000; + if (delaySecs != null) { + const completeTimestamp = + new Date(withdrawal.createdTimestamp).getTime() + + delaySecs * 1000; - if (Date.now() < completeTimestamp) { - setState({ - status: ApprovalStatus.Delayed, - threshold, - completeTimestamp, - }); - return false; + if (Date.now() < completeTimestamp) { + setState({ + status: ApprovalStatus.Delayed, + threshold, + completeTimestamp, + }); + return false; + } } }