diff --git a/package-lock.json b/package-lock.json index 59d5ebb11..06d783126 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3606,9 +3606,9 @@ } }, "@oceanprotocol/react": { - "version": "0.0.34", - "resolved": "https://registry.npmjs.org/@oceanprotocol/react/-/react-0.0.34.tgz", - "integrity": "sha512-xgKNuVszU0eYtDnByPaI0PSZgO1S+haWlMOGvmLTfxiKv2A/m2qK09gFiY5SgiGsPozphG5daTw7M0dyf0tD1w==", + "version": "0.0.36", + "resolved": "https://registry.npmjs.org/@oceanprotocol/react/-/react-0.0.36.tgz", + "integrity": "sha512-IUiA3zWGUBUb23bW+Oxg9QDd7rS6EVVCDqxkvbGqOuNxPybKqZMs5JNzQGW9hJY6SrmrBQGY114b3+CxoCULUA==", "requires": { "@oceanprotocol/lib": "^0.1.11", "axios": "^0.19.2", diff --git a/package.json b/package.json index 6e268c8c3..8e9e713b3 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "@loadable/component": "^5.13.1", "@oceanprotocol/art": "^3.0.0", "@oceanprotocol/lib": "^0.1.11", - "@oceanprotocol/react": "^0.0.34", + "@oceanprotocol/react": "^0.0.36", "@oceanprotocol/typographies": "^0.1.0", "@sindresorhus/slugify": "^1.0.0", "@tippyjs/react": "^4.1.0", diff --git a/src/components/atoms/Price/index.tsx b/src/components/atoms/Price/index.tsx index ad4efcd9d..854fc06a0 100644 --- a/src/components/atoms/Price/index.tsx +++ b/src/components/atoms/Price/index.tsx @@ -21,18 +21,19 @@ export default function Price({ small?: boolean setPriceOutside?: (price: string) => void }): ReactElement { - const { chainId } = useOcean() + const { ocean, chainId, accountId } = useOcean() const { getBestPrice } = useMetadata() const [price, setPrice] = useState() useEffect(() => { async function init() { + console.log(ocean) const price = await getBestPrice(ddo.dataToken) setPrice(price) setPriceOutside && price !== '' && setPriceOutside(price) } init() - }, [chainId]) + }, [chainId, accountId, ocean]) const styleClasses = cx({ price: true, @@ -51,7 +52,9 @@ export default function Price({ ) - return price ? ( + return !ocean ? ( +
Please connect your wallet to view price
+ ) : price ? (
{displayPrice}
) : price === '' ? (