diff --git a/src/components/organisms/AssetContent/index.tsx b/src/components/organisms/AssetContent/index.tsx index f96fee96e..eb32c6288 100644 --- a/src/components/organisms/AssetContent/index.tsx +++ b/src/components/organisms/AssetContent/index.tsx @@ -48,14 +48,16 @@ export default function AssetContent(props: AssetContentProps): ReactElement { const [showPricing, setShowPricing] = useState(false) const [showEdit, setShowEdit] = useState() const [showEditCompute, setShowEditCompute] = 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