explorer: Hide banner when lockup has expired (#14473)

This commit is contained in:
Justin Starry 2021-01-07 21:26:18 +08:00 committed by GitHub
parent 17337441c6
commit 3fc7362486
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -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 (
<div className="alert alert-warning text-center">
<strong>Account is locked!</strong> Lockup expires on {prettyTimestamp}