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:
parent
240cb258f3
commit
c02e91a0c5
@ -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) => ({
|
||||
|
@ -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}
|
||||
|
@ -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}`}
|
||||
|
Loading…
x
Reference in New Issue
Block a user