diff --git a/src/components/molecules/Bookmarks.tsx b/src/components/molecules/Bookmarks.tsx index cf46614b2..38cf8b9e2 100644 --- a/src/components/molecules/Bookmarks.tsx +++ b/src/components/molecules/Bookmarks.tsx @@ -67,7 +67,7 @@ export default function Bookmarks(): ReactElement { const [isLoading, setIsLoading] = useState() useEffect(() => { - if (!config || bookmarks === {}) return + if (!config?.metadataCacheUri || bookmarks === {}) return const networkName = (config as ConfigHelperConfig).network diff --git a/src/components/organisms/AssetActions/Pool/index.tsx b/src/components/organisms/AssetActions/Pool/index.tsx index 54460e465..790235993 100644 --- a/src/components/organisms/AssetActions/Pool/index.tsx +++ b/src/components/organisms/AssetActions/Pool/index.tsx @@ -203,7 +203,13 @@ export default function Pool({ ddo }: { ddo: DDO }): ReactElement { // Get graph history data useEffect(() => { - if (!price?.address || !price?.ocean || !price?.value) return + if ( + !price?.address || + !price?.ocean || + !price?.value || + !config?.metadataCacheUri + ) + return const source = axios.CancelToken.source() const url = `${config.metadataCacheUri}/api/v1/aquarius/pools/history/${price.address}` diff --git a/src/components/pages/History/PoolShares.tsx b/src/components/pages/History/PoolShares.tsx index a44840363..ad7603f8d 100644 --- a/src/components/pages/History/PoolShares.tsx +++ b/src/components/pages/History/PoolShares.tsx @@ -67,7 +67,7 @@ export default function PoolShares(): ReactElement { useEffect(() => { async function getAssets() { - if (!ocean || !accountId) return + if (!ocean || !accountId || !config?.metadataCacheUri) return setIsLoading(true) try { diff --git a/src/components/pages/Home.tsx b/src/components/pages/Home.tsx index a20fa6db0..e3c5462c2 100644 --- a/src/components/pages/Home.tsx +++ b/src/components/pages/Home.tsx @@ -112,6 +112,8 @@ export default function HomePage(): ReactElement { const [loading, setLoading] = useState(true) useEffect(() => { + if (!config?.metadataCacheUri) return + // TODO: remove any once ocean.js has nativeSearch typings async function init() { const queryResultHighest = await getAssets( diff --git a/src/components/templates/AssetDetails.tsx b/src/components/templates/AssetDetails.tsx index 4972e4c58..9444bacd4 100644 --- a/src/components/templates/AssetDetails.tsx +++ b/src/components/templates/AssetDetails.tsx @@ -22,6 +22,8 @@ export default function PageTemplateAssetDetails({ const [ddo, setDdo] = useState() useEffect(() => { + if (!config?.metadataCacheUri) return + async function init() { if (ddo) return diff --git a/src/components/templates/Search/index.tsx b/src/components/templates/Search/index.tsx index 07900e922..7d2423471 100644 --- a/src/components/templates/Search/index.tsx +++ b/src/components/templates/Search/index.tsx @@ -20,6 +20,8 @@ export default function SearchPage({ const [loading, setLoading] = useState() useEffect(() => { + if (!config?.metadataCacheUri) return + async function initSearch() { setLoading(true) const queryResult = await getResults(parsed, config.metadataCacheUri)