From bced42dcdd21a32b10beea293939e910d48dce8b Mon Sep 17 00:00:00 2001 From: Bogdan Fazakas Date: Tue, 29 Aug 2023 16:18:53 +0300 Subject: [PATCH] fix checks --- src/components/@shared/AssetTeaser/index.tsx | 2 +- src/components/Asset/AssetActions/Compute/index.tsx | 4 ++-- src/components/Asset/AssetActions/Download.tsx | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/@shared/AssetTeaser/index.tsx b/src/components/@shared/AssetTeaser/index.tsx index 7d7a0aa84..37477a954 100644 --- a/src/components/@shared/AssetTeaser/index.tsx +++ b/src/components/@shared/AssetTeaser/index.tsx @@ -33,7 +33,7 @@ export default function AssetTeaser({ const price: AssetPrice = asset.stats.price.value ? asset?.stats?.price : { - value: Number(asset.accessDetails.price), + value: Number(asset?.accessDetails?.price), tokenSymbol: asset?.accessDetails?.baseToken?.symbol, tokenAddress: asset?.accessDetails?.baseToken?.address } diff --git a/src/components/Asset/AssetActions/Compute/index.tsx b/src/components/Asset/AssetActions/Compute/index.tsx index a4831543f..534822cd9 100644 --- a/src/components/Asset/AssetActions/Compute/index.tsx +++ b/src/components/Asset/AssetActions/Compute/index.tsx @@ -111,10 +111,10 @@ export default function Compute({ const { isSupportedOceanNetwork } = useNetworkMetadata() const { isAssetNetwork } = useAsset() - const price: AssetPrice = asset.stats.price.value + const price: AssetPrice = asset?.stats?.price?.value ? asset?.stats?.price : { - value: Number(asset.accessDetails.price), + value: Number(asset?.accessDetails?.price), tokenSymbol: asset?.accessDetails?.baseToken?.symbol, tokenAddress: asset?.accessDetails?.baseToken?.address } diff --git a/src/components/Asset/AssetActions/Download.tsx b/src/components/Asset/AssetActions/Download.tsx index bb1661739..12e85030e 100644 --- a/src/components/Asset/AssetActions/Download.tsx +++ b/src/components/Asset/AssetActions/Download.tsx @@ -58,10 +58,10 @@ export default function Download({ useState() const [retry, setRetry] = useState(false) - const price: AssetPrice = asset.stats.price.value + const price: AssetPrice = asset?.stats?.price?.value ? asset?.stats?.price : { - value: Number(asset.accessDetails.price), + value: Number(asset?.accessDetails?.price), tokenSymbol: asset?.accessDetails?.baseToken?.symbol, tokenAddress: asset?.accessDetails?.baseToken?.address }