1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

Preventing the market from crashing when an asset doesn't have any services

This commit is contained in:
Jamie Hewitt 2022-11-02 14:36:50 +03:00
parent 240cb258f3
commit c02e91a0c5
3 changed files with 5 additions and 5 deletions

View File

@ -124,8 +124,8 @@ function AssetProvider({
const accessDetails = await getAccessDetails(
asset.chainId,
asset.services[0].datatokenAddress,
asset.services[0].timeout,
asset?.services?.[0]?.datatokenAddress,
asset?.services?.[0]?.timeout,
accountId
)
setAsset((prevState) => ({

View File

@ -169,7 +169,7 @@ export default function Download({
dtSymbol={asset?.datatokens[0]?.symbol}
dtBalance={dtBalance}
onClick={handleOrderOrDownload}
assetTimeout={secondsToString(asset.services[0].timeout)}
assetTimeout={secondsToString(asset?.services?.[0]?.timeout)}
assetType={asset?.metadata?.type}
stepText={statusText}
isLoading={isLoading}

View File

@ -30,8 +30,8 @@ export default function MetaAsset({
networkId={asset?.chainId}
path={
isBlockscoutExplorer
? `tokens/${asset?.services[0].datatokenAddress}`
: `token/${asset?.services[0].datatokenAddress}`
? `tokens/${asset?.services?.[0]?.datatokenAddress}`
: `token/${asset?.services?.[0]?.datatokenAddress}`
}
>
{`Accessed with ${dataTokenSymbol}`}