From 3fc73624862c65b5864666a85d6f16ce1f589699 Mon Sep 17 00:00:00 2001 From: Justin Starry Date: Thu, 7 Jan 2021 21:26:18 +0800 Subject: [PATCH] explorer: Hide banner when lockup has expired (#14473) --- explorer/src/components/account/StakeAccountSection.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/explorer/src/components/account/StakeAccountSection.tsx b/explorer/src/components/account/StakeAccountSection.tsx index 00307ffca6..f98ce050e5 100644 --- a/explorer/src/components/account/StakeAccountSection.tsx +++ b/explorer/src/components/account/StakeAccountSection.tsx @@ -48,9 +48,9 @@ export function StakeAccountSection({ } function LockupCard({ stakeAccount }: { stakeAccount: StakeAccountInfo }) { - const unixTimestamp = stakeAccount.meta?.lockup.unixTimestamp; - if (unixTimestamp && unixTimestamp > 0) { - const prettyTimestamp = displayTimestampUtc(unixTimestamp * 1000); + const unixTimestamp = 1000 * (stakeAccount.meta?.lockup.unixTimestamp || 0); + if (Date.now() < unixTimestamp) { + const prettyTimestamp = displayTimestampUtc(unixTimestamp); return (
Account is locked! Lockup expires on {prettyTimestamp}