Skip to content

Commit

Permalink
ContractDescription trustworthy close
Browse files Browse the repository at this point in the history
  • Loading branch information
mantikoros committed Apr 7, 2023
1 parent 8a66007 commit 3820006
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions web/components/contract/contract-description.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@ export function ContractDescription(props: {
className?: string
}) {
const { contract, className, toggleResolver } = props
const { creatorId, closeTime } = contract

const isAdmin = useAdmin()
const user = useUser()
const isCreator = user?.id === contract.creatorId
const trustworthy = isTrustworthy(user?.username)
const isCreator = user?.id === creatorId
const isClosed = !!(closeTime && closeTime < Date.now())
const trustworthy = isTrustworthy(user?.username) && isClosed

const showContractActions =
user &&
(isCreator || isAdmin || trustworthy) &&
Expand Down

0 comments on commit 3820006

Please sign in to comment.