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

fix algo list fetching

* closes #1537
* addresses #1538
This commit is contained in:
Matthias Kretschmann 2022-06-23 14:50:58 +01:00
parent 98beb1c3af
commit ec34dc8f53
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -177,16 +177,15 @@ export async function getAlgorithmsForAsset(
const publisherTrustedAlgorithms =
computeService.compute.publisherTrustedAlgorithms || []
let algorithms: Asset[]
if (!computeService.compute) {
algorithms = []
} else {
const gueryResults = await queryMetadata(
getQueryString(publisherTrustedAlgorithms, asset.chainId),
token
)
algorithms = gueryResults?.results
if (!computeService.compute || publisherTrustedAlgorithms.length === 0) {
return []
}
const gueryResults = await queryMetadata(
getQueryString(publisherTrustedAlgorithms, asset.chainId),
token
)
const algorithms: Asset[] = gueryResults?.results
return algorithms
}