diff --git a/src/components/organisms/AssetContent/index.tsx b/src/components/organisms/AssetContent/index.tsx index f08891388..0d281a011 100644 --- a/src/components/organisms/AssetContent/index.tsx +++ b/src/components/organisms/AssetContent/index.tsx @@ -46,13 +46,16 @@ export default function AssetContent(props: AssetContentProps): ReactElement { const { owner, isInPurgatory, purgatoryData } = useAsset() const [showPricing, setShowPricing] = useState(false) const [showEdit, setShowEdit] = useState() + const [isOwner, setIsOwner] = useState(false) const { ddo, price, metadata } = useAsset() - const isOwner = accountId === owner useEffect(() => { - if (!price) return + if (!accountId || !owner) return + + const isOwner = accountId.toLowerCase() === owner.toLowerCase() + setIsOwner(isOwner) setShowPricing(isOwner && price.type === '') - }, [isOwner, price]) + }, [accountId, price, owner]) function handleEditButton() { // move user's focus to top of screen